summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAge
* Fall back to selection DAG isel for calls to builtin functions.Bob Wilson2012-08-03
| | | | | | | | | | Fast isel doesn't currently have support for translating builtin function calls to target instructions. For embedded environments where the library functions are not available, this is a matter of correctness and not just optimization. Most of this patch is just arranging to make the TargetLibraryInfo available in fast isel. <rdar://problem/12008746> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161232 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new getLibFunc method to TargetLibraryInfo.Bob Wilson2012-08-03
| | | | | | | | This just provides a way to look up a LibFunc::Func enum value for a function name. Alphabetize the enums and function names so we can use a binary search. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161231 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the "findUsedStructTypes" functionality outside of the Module class.Bill Wendling2012-08-03
| | | | | | | | | | The "findUsedStructTypes" method is very expensive to run. It needs to be optimized so that LTO can run faster. Splitting this method out of the Module class will help this occur. For instance, it can keep a list of seen objects so that it doesn't process them over and over again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161228 91177308-0d34-0410-b5e6-96231b3b80d8
* X86 Peephole: fold loads to the source register operand if possible.Manman Ren2012-08-02
| | | | | | | | | | | Add more comments and use early returns to reduce nesting in isLoadFoldable. Also disable folding for V_SET0 to avoid introducing a const pool entry and a const pool load. rdar://10554090 and rdar://11873276 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161207 91177308-0d34-0410-b5e6-96231b3b80d8
* Add yaml2obj. A utility to convert YAML to binaries.Michael J. Spencer2012-08-02
| | | | | | | | yaml2obj takes a textual description of an object file in YAML format and outputs the binary equivalent. This greatly simplifies writing tests that take binary object files as input. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161205 91177308-0d34-0410-b5e6-96231b3b80d8
* Add TargetRegisterInfo::hasRegUnit().Jakob Stoklund Olesen2012-08-02
| | | | | | | This trivial helper function tests if a register contains a register unit. It is similar to regsOverlap(), but with asymmetric arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161180 91177308-0d34-0410-b5e6-96231b3b80d8
* include/llvm/Analysis/RegionInfo.h: Appease msvc.NAKAMURA Takumi2012-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161179 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the block_iterator of Region based on df_iterator.Hongbin Zheng2012-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161177 91177308-0d34-0410-b5e6-96231b3b80d8
* X86 Peephole: fold loads to the source register operand if possible.Manman Ren2012-08-02
| | | | | | | | | | | | | Machine CSE and other optimizations can remove instructions so folding is possible at peephole while not possible at ISel. This patch is a rework of r160919 and was tested on clang self-host on my local machine. rdar://10554090 and rdar://11873276 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161152 91177308-0d34-0410-b5e6-96231b3b80d8
* Reference IntrusiveRefCntPtr in doxygen doc of RefCountedBase to get a link ↵Axel Naumann2012-08-01
| | | | | | to the pointer class documentation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161112 91177308-0d34-0410-b5e6-96231b3b80d8
* Add range erase, element insert, and range insert methods toChandler Carruth2012-08-01
| | | | | | | | | | | | | | | TinyPtrVector. With these, it is sufficiently functional for my more normal / pedestrian uses. I've not included some r-value reference stuff here because the value type for a TinyPtrVector is, necessarily, just a pointer. I've added tests that cover the basic behavior of these routines, but they aren't as comprehensive as I'd like. In particular, they don't really test the iterator semantics as thoroughly as they should. Maybe some brave soul will feel enterprising and flesh them out. ;] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161104 91177308-0d34-0410-b5e6-96231b3b80d8
* Add basic in-bounds asserts to TinyPtrVector::erase.Chandler Carruth2012-08-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161103 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial commit of new FileOutputBuffer support class. Nick Kledzik2012-08-01
| | | | | | | | | Since the llvm::sys::fs::map_file_pages() support function it relies on is not yet implemented on Windows, the unit tests for FileOutputBuffer are currently conditionalized to run only on unix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161099 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix shadowed variable warningNick Kledzik2012-08-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161097 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement copy and move assignment for TinyPtrVector. These try toChandler Carruth2012-07-31
| | | | | | re-use allocated vectors as much as possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161041 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up trailing whitespace and unnecessary blank lines.Chandler Carruth2012-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161025 91177308-0d34-0410-b5e6-96231b3b80d8
* Bring TinyPtrVector under test. Somehow we never picked up unit testsChandler Carruth2012-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | for this class. These tests exercise most of the basic properties, but the API for TinyPtrVector is very strange currently. My plan is to start fleshing out the API to match that of SmallVector, but I wanted a test for what is there first. Sadly, it doesn't look reasonable to just re-use the SmallVector tests, as this container can only ever store pointers, and much of the SmallVector testing is to get construction and destruction right. Just to get this basic test working, I had to add value_type to the interface. While here I found a subtle bug in the combination of 'erase', 'begin', and 'end'. Both 'begin' and 'end' wanted to use a null pointer to indicate the "end" iterator of an empty vector, regardless of whether there is actually a vector allocated or the pointer union is null. Everything else was fine with this except for erase. If you erase the last element of a vector after it has held more than one element, we return the end iterator of the underlying SmallVector which need not be a null pointer. Instead, simply use the pointer, and poniter + size() begin/end definitions in the tiny case, and delegate to the inner vector whenever it is present. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161024 91177308-0d34-0410-b5e6-96231b3b80d8
* Added MachineRegisterInfo::hasOneDef()Andrew Trick2012-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161009 91177308-0d34-0410-b5e6-96231b3b80d8
* Inline MachineRegisterInfo::hasOneUseAndrew Trick2012-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161007 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the InstVisitor to visit the specialized classes wrappingChandler Carruth2012-07-30
| | | | | | | | CallInst for intrinsics. This allows users of the InstVisitor that would like to special case certain very common intrinsics to do so naturally in keeping with the type hierarchy's utility classes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161006 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the SmallVector unit tests to be type-parameterized so that we canChandler Carruth2012-07-30
| | | | | | | | | | | | | | | | | | | | test more than a single instantiation of SmallVector. Add testing for 0, 1, 2, and 4 element sized "small" buffers. These appear to be essentially untested in the unit tests until now. Fix several tests to be robust in the face of a '0' small buffer. As a consequence of this size buffer, the growth patterns are actually observable in the test -- yes this means that many tests never caused a grow to occur before. For some tests I've merely added a reserve call to normalize behavior. For others, the growth is actually interesting, and so I captured the fact that growth would occur and adjusted the assertions to not assume how rapidly growth occured. Also update the specialization for a '0' small buffer length to have all the same interface points as the normal small vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161001 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo.Eric Christopher2012-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160981 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MachineInstr::isTransient().Jakob Stoklund Olesen2012-07-30
| | | | | | | | | | | This is a cleaned up version of the isFree() function in MachineTraceMetrics.cpp. Transient instructions are very unlikely to produce any code in the final output. Either because they get eliminated by RegisterCoalescing, or because they are pseudo-instructions like labels and debug values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160977 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MachineBasicBlock::isPredecessor().Jakob Stoklund Olesen2012-07-30
| | | | | | | | A->isPredecessor(B) is the same as B->isSuccessor(A), but it can tolerate a B that is null or dangling. This shouldn't happen normally, but it it useful for verification code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160968 91177308-0d34-0410-b5e6-96231b3b80d8
* APInt: Simplify code.Benjamin Kramer2012-07-29
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160929 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r160920 and r160919 due to dragonegg and clang selfhost failureManman Ren2012-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160927 91177308-0d34-0410-b5e6-96231b3b80d8
* X86 Peephole: fold loads to the source register operand if possible.Manman Ren2012-07-28
| | | | | | | | | | Machine CSE and other optimizations can remove instructions so folding is possible at peephole while not possible at ISel. rdar://10554090 and rdar://11873276 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160919 91177308-0d34-0410-b5e6-96231b3b80d8
* Also compute register mask lists under -new-live-intervals.Jakob Stoklund Olesen2012-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160898 91177308-0d34-0410-b5e6-96231b3b80d8
* Typos.Chad Rosier2012-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160897 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the IS_PHI_DEF flag and VNInfo::setIsPHIDef().Jakob Stoklund Olesen2012-07-27
| | | | | | | | A value number is a PHI def if and only if it begins at a block boundary. This can be derived from the def slot, a separate flag is not necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160893 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a -new-live-intervals experimental option.Jakob Stoklund Olesen2012-07-27
| | | | | | | | | This option replaces the existing live interval computation with one based on LiveRangeCalc.cpp. The new algorithm does not depend on LiveVariables, and it can be run at any time, before or after leaving SSA form. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160892 91177308-0d34-0410-b5e6-96231b3b80d8
* SmallVector: Crank up verbosity of asserts per Chandler's request.Benjamin Kramer2012-07-27
| | | | | | Also add assertions to validate the iterator in the insert method overloads. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160882 91177308-0d34-0410-b5e6-96231b3b80d8
* Give MCRegisterInfo an implementation file.Jakob Stoklund Olesen2012-07-27
| | | | | | | | Move some functions from MCRegisterInfo.h that don't need to be inline. This shrinks llc by 8K. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160865 91177308-0d34-0410-b5e6-96231b3b80d8
* SmallVector::erase: Assert that iterators are actually inside the vector.Benjamin Kramer2012-07-27
| | | | | | | | The rationale here is that it's hard to write loops containing vector erases and it only shows up if the vector contains non-trivial objects leading to crashes when forming them out of garbage memory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160854 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the large XXXSubRegTable constant arrays.Jakob Stoklund Olesen2012-07-27
| | | | | | | | | | | These tables were indexed by [register][subreg index] which made them, very large and sparse. Replace them with lists of sub-register indexes that match the existing lists of sub-registers. MCRI::getSubReg() becomes a very short linear search, like getSubRegIndex() already was. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160843 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support for 'CompositeIndices' and sub-register cycles.Jakob Stoklund Olesen2012-07-26
| | | | | | | | | | | | Now that the weird X86 sub_ss and sub_sd sub-register indexes are gone, there is no longer a need for the CompositeIndices construct in .td files. Sub-register index composition can be specified on the SubRegIndex itself using the ComposedOf field. Also enforce unique names for sub-registers in TableGen. The same sub-register cannot be available with multiple sub-register indexes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160842 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for v16i32/v16i64 into the code generator. This is required for ↵Micah Villmow2012-07-26
| | | | | | backends that use i32/i64 vectors for the getSetCCResultType function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160814 91177308-0d34-0410-b5e6-96231b3b80d8
* Make comments in Debug.cpp and Debug.h consistent. Rename SetCurrentDebugType;Chad Rosier2012-07-26
| | | | | | | Function names should be camel case, and start with a lower case letter. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160813 91177308-0d34-0410-b5e6-96231b3b80d8
* Start scaffolding for a MachineTraceMetrics analysis pass.Jakob Stoklund Olesen2012-07-26
| | | | | | | | | | | | | | | | | | | | | | | | This is still a work in progress. Out-of-order CPUs usually execute instructions from multiple basic blocks simultaneously, so it is necessary to look at longer traces when estimating the performance effects of code transformations. The MachineTraceMetrics analysis will pick a typical trace through a given basic block and provide performance metrics for the trace. Metrics will include: - Instruction count through the trace. - Issue count per functional unit. - Critical path length, and per-instruction 'slack'. These metrics can be used to determine the performance limiting factor when executing the trace, and how it will be affected by a code transformation. Initially, this will be used by the early if-conversion pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160796 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a floor intrinsic.Dan Gohman2012-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160791 91177308-0d34-0410-b5e6-96231b3b80d8
* Differentially encode all MC register lists.Jakob Stoklund Olesen2012-07-25
| | | | | | | This simplifies MCRegisterInfo and shrinks the target descriptions a bit more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160758 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r160742: it's breaking CMake buildNuno Lopes2012-07-25
| | | | | | | original commit msg: MemoryBuiltins: add support to determine the size of strdup'ed non-constant strings git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160751 91177308-0d34-0410-b5e6-96231b3b80d8
* MemoryBuiltins: add support to determine the size of strdup'ed non-constant ↵Nuno Lopes2012-07-25
| | | | | | strings git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160742 91177308-0d34-0410-b5e6-96231b3b80d8
* add EmitStrNLen()Nuno Lopes2012-07-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160741 91177308-0d34-0410-b5e6-96231b3b80d8
* make all Emit*() functions consult the TargetLibraryInfo information before ↵Nuno Lopes2012-07-25
| | | | | | | | | creating a call to a library function. Update all clients to pass the TLI information around. Previous draft reviewed by Eli. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160733 91177308-0d34-0410-b5e6-96231b3b80d8
* In order to correctly compileRafael Espindola2012-07-24
| | | | | | | | | | | | | | | | | struct s { double x1; float x2; }; __attribute__((regparm(3))) struct s f(int a, int b, int c); void g(void) { f(41, 42, 43); } We need to be able to represent passing the address of s to f (sret) in a register (inreg). Turns out that all that is needed is to not mark them as mutually incompatible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160695 91177308-0d34-0410-b5e6-96231b3b80d8
* [Object] Remove unneeded const_cast.Michael J. Spencer2012-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160692 91177308-0d34-0410-b5e6-96231b3b80d8
* add a few more functions to TargetLibraryInfo:Nuno Lopes2012-07-24
| | | | | | fputc, memchr, memcmp, putchar, puts, strchr, strncmp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160690 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new interfaces to support ldd's ReaderElf.cpp.Anshuman Dasgupta2012-07-24
| | | | | | | Patch by Sid Manning! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160685 91177308-0d34-0410-b5e6-96231b3b80d8
* TargetLibraryInfo: add strn?cat, strn?cpy, and strn?lenNuno Lopes2012-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160678 91177308-0d34-0410-b5e6-96231b3b80d8