aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Move the LowerMEMCPY and LowerMEMCPYCall to a common place.Rafael Espindola2007-11-055-107/+65
| | | | | | | | Thanks for the suggestions Bill :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43742 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support in serializer and deserializer to create arbitrary blocks.Ted Kremenek2007-11-052-4/+34
| | | | | | | Added detection of end-of-stream in deserializer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43736 91177308-0d34-0410-b5e6-96231b3b80d8
* Make labels work in asm blocks; allow labels asDale Johannesen2007-11-0510-789/+876
| | | | | | | | | parameters. Rename ValueRefList to ParamList in AsmParser, since its only use is for parameters. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43734 91177308-0d34-0410-b5e6-96231b3b80d8
* Added default creation of root-level block by bitstream serializer.Ted Kremenek2007-11-051-3/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43732 91177308-0d34-0410-b5e6-96231b3b80d8
* If a value is incoming from outside the loop then the value does not need ↵Devang Patel2007-11-051-3/+0
| | | | | | remapping and the value is never tracked through LastValueMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43728 91177308-0d34-0410-b5e6-96231b3b80d8
* [ARM] Fix code generation for:Lauro Ramos Venancio2007-11-051-1/+1
| | | | | | | | | | | static __thread struct { int a; int b; } teste = {0, 0}; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43722 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't output ABI size padding twice. By using the storeDuncan Sands2007-11-051-5/+6
| | | | | | | | size for the field we get ABI padding automatically, so no need to put it in again when we emit the field. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43720 91177308-0d34-0410-b5e6-96231b3b80d8
* Move SimpleRegisterCoalescing.h to lib/CodeGen since there is now a commonEvan Cheng2007-11-052-2/+186
| | | | | | | register coalescer interface: RegisterCoalescing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43714 91177308-0d34-0410-b5e6-96231b3b80d8
* Use movups to spill / restore SSE registers on targets where stacks alignment isEvan Cheng2007-11-052-15/+24
| | | | | | | | less than 16. This is a temporary solution until dynamic stack alignment is implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43703 91177308-0d34-0410-b5e6-96231b3b80d8
* Skip over deleted val#'s.Evan Cheng2007-11-051-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43700 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle cases where a register and one of its super-register are both marked asEvan Cheng2007-11-051-2/+4
| | | | | | | defined on the same instruction. This fixes PR1767. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43699 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support for PIC code with "explicit relocations" *only*.Bruno Cardoso Lopes2007-11-059-104/+215
| | | | | | | | Removed all macro code for PIC (goodbye "la"). Support tested with shootout bench. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43697 91177308-0d34-0410-b5e6-96231b3b80d8
* Deleting redundant copy of block extractor pass. See also PR1775.Gordon Henriksen2007-11-051-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43694 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1187.Evan Cheng2007-11-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43692 91177308-0d34-0410-b5e6-96231b3b80d8
* If a long double is in a packed struct, it may beDuncan Sands2007-11-051-5/+7
| | | | | | | that there is no padding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43691 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the remaining uses of getTypeSize. ThisDuncan Sands2007-11-0514-51/+52
| | | | | | | | | | | | | | | should only effect x86 when using long double. Now 12/16 bytes are output for long double globals (the exact amount depends on the alignment). This brings globals in line with the rest of LLVM: the space reserved for an object is now always the ABI size. One tricky point is that only 10 bytes should be output for long double if it is a field in a packed struct, which is the reason for the additional argument to EmitGlobalConstant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43688 91177308-0d34-0410-b5e6-96231b3b80d8
* Another step of stronger PHI elimination down.Owen Anderson2007-11-041-0/+88
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43684 91177308-0d34-0410-b5e6-96231b3b80d8
* Deleting -emitbitcode option which did nothing.Gordon Henriksen2007-11-041-6/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43683 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1761 by not printing (rip) suffix when in -static mode.Chris Lattner2007-11-041-1/+2
| | | | | | | Evan, please review this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43680 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash before main on ppc/linux with static constructors. PR1771Nick Lewycky2007-11-042-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43676 91177308-0d34-0410-b5e6-96231b3b80d8
* Finishing initial docs for all transformations in Passes.html.Gordon Henriksen2007-11-045-22/+20
| | | | | | Also cleaned up some comments in source files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43674 91177308-0d34-0410-b5e6-96231b3b80d8
* Change uses of getTypeSize to getABITypeSize, getTypeStoreSizeDuncan Sands2007-11-041-44/+56
| | | | | | | | | | | | | | | | | | | | | | | or getTypeSizeInBits as appropriate in ScalarReplAggregates. The right change to make was not always obvious, so it would be good to have an sroa guru review this. While there I noticed some bugs, and fixed them: (1) arrays of x86 long double have holes due to alignment padding, but this wasn't being spotted by HasStructPadding (renamed to HasPadding). The same goes for arrays of oddly sized ints. Vectors also suffer from this, in fact the problem for vectors is much worse because basic vector assumptions seem to be broken by vectors of type with alignment padding. I didn't try to fix any of these vector problems. (2) The code for extracting smaller integers from larger ones (in the "int union" case) was wrong on big-endian machines for integers with size not a multiple of 8, like i1. Probably this is impossible to hit via llvm-gcc, but I fixed it anyway while there and added a testcase. I also got rid of some trailing whitespace and changed a function name which had an obvious typo in it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43672 91177308-0d34-0410-b5e6-96231b3b80d8
* If an interval is being undone clear its preference as well since the source ↵Evan Cheng2007-11-041-1/+6
| | | | | | interval may have been undone as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43670 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1763 by allowing the 'q' constraint to work with 64-bitChris Lattner2007-11-041-1/+3
| | | | | | | regs on x86-64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43669 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable tail duplication of call instructions. The costChris Lattner2007-11-041-0/+5
| | | | | | | | | metric is way off for these in general, and this works around buggy code like that in PR1764. we'll see if there is a big performance impact of this. If so, I'll revert it tomorrow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43668 91177308-0d34-0410-b5e6-96231b3b80d8
* There are times when the coalescer would not coalesce away a copy but the copyEvan Cheng2007-11-032-9/+122
| | | | | | | | | | | | | | | | | can be eliminated by the allocator is the destination and source targets the same register. The most common case is when the source and destination registers are in different class. For example, on x86 mov32to32_ targets GR32_ which contains a subset of the registers in GR32. The allocator can do 2 things: 1. Set the preferred allocation for the destination of a copy to that of its source. 2. After allocation is done, change the allocation of a copy destination (if legal) so the copy can be eliminated. This eliminates 443 extra moves from 403.gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43662 91177308-0d34-0410-b5e6-96231b3b80d8
* Add std:: to sort calls.Dan Gohman2007-11-022-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43652 91177308-0d34-0410-b5e6-96231b3b80d8
* Change illegal uses of ++ to uses of STLExtra.h's next function.Dan Gohman2007-11-022-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43651 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak tailcall opt.Evan Cheng2007-11-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43646 91177308-0d34-0410-b5e6-96231b3b80d8
* One more extract_subreg coalescing bug.Evan Cheng2007-11-021-5/+33
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43644 91177308-0d34-0410-b5e6-96231b3b80d8
* add a noteChris Lattner2007-11-021-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43642 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a thinko.Duncan Sands2007-11-021-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43639 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some unnecessary C-style statics.Neil Booth2007-11-021-6/+8
| | | | | | | Restore an assertion that arithmetic can be performed on this format. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43638 91177308-0d34-0410-b5e6-96231b3b80d8
* Missing a getNumOperands check.Evan Cheng2007-11-021-22/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43630 91177308-0d34-0410-b5e6-96231b3b80d8
* Add back line whose removal somehow crept into prior patchNeil Booth2007-11-011-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43627 91177308-0d34-0410-b5e6-96231b3b80d8
* When converting to integer, do bit manipulations in the destinationNeil Booth2007-11-011-71/+107
| | | | | | | | | | | | | memory rather than in a copy of the APFloat. This avoids problems when the destination is wider than our significand and is cleaner. Also provide deterministic values in all cases where conversion fails, namely zero for NaNs and the minimal or maximal value respectively for underflow or overflow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43626 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed ReadVal from SerializeTrait<T>, and also removed it fromTed Kremenek2007-11-011-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deserializer. There were issues with Visual C++ barfing when instantiating SerializeTrait<T> when "T" was an abstract class AND SerializeTrait<T>::ReadVal was *never* called: template <typename T> struct SerializeTrait { <SNIP> static inline T ReadVal(Deserializer& D) { T::ReadVal(D); } <SNIP> }; Visual C++ would complain about "T" being an abstract class, even though ReadVal was never instantiated (although one of the other member functions were). Removing this from the trait is not a big deal. It was used hardly ever, and users who want "read-by-value" deserialization can simply call the appropriate methods directly instead of relying on trait-based-dispatch. The trait dispatch for serialization/deserialization is simply sugar in many cases (like this one). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43624 91177308-0d34-0410-b5e6-96231b3b80d8
* Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.Duncan Sands2007-11-0123-132/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The meaning of getTypeSize was not clear - clarifying it is important now that we have x86 long double and arbitrary precision integers. The issue with long double is that it requires 80 bits, and this is not a multiple of its alignment. This gives a primitive type for which getTypeSize differed from getABITypeSize. For arbitrary precision integers it is even worse: there is the minimum number of bits needed to hold the type (eg: 36 for an i36), the maximum number of bits that will be overwriten when storing the type (40 bits for i36) and the ABI size (i.e. the storage size rounded up to a multiple of the alignment; 64 bits for i36). This patch removes getTypeSize (not really - it is still there but deprecated to allow for a gradual transition). Instead there is: (1) getTypeSizeInBits - a number of bits that suffices to hold all values of the type. For a primitive type, this is the minimum number of bits. For an i36 this is 36 bits. For x86 long double it is 80. This corresponds to gcc's TYPE_PRECISION. (2) getTypeStoreSizeInBits - the maximum number of bits that is written when storing the type (or read when reading it). For an i36 this is 40 bits, for an x86 long double it is 80 bits. This is the size alias analysis is interested in (getTypeStoreSize returns the number of bytes). There doesn't seem to be anything corresponding to this in gcc. (3) getABITypeSizeInBits - this is getTypeStoreSizeInBits rounded up to a multiple of the alignment. For an i36 this is 64, for an x86 long double this is 96 or 128 depending on the OS. This is the spacing between consecutive elements when you form an array out of this type (getABITypeSize returns the number of bytes). This is TYPE_SIZE in gcc. Since successive elements in a SequentialType (arrays, pointers and vectors) need to be aligned, the spacing between them will be given by getABITypeSize. This means that the size of an array is the length times the getABITypeSize. It also means that GEP computations need to use getABITypeSize when computing offsets. Furthermore, if an alloca allocates several elements at once then these too need to be aligned, so the size of the alloca has to be the number of elements multiplied by getABITypeSize. Logically speaking this doesn't have to be the case when allocating just one element, but it is simpler to also use getABITypeSize in this case. So alloca's and mallocs should use getABITypeSize. Finally, since gcc's only notion of size is that given by getABITypeSize, if you want to output assembler etc the same as gcc then getABITypeSize is the size you want. Since a store will overwrite no more than getTypeStoreSize bytes, and a read will read no more than that many bytes, this is the notion of size appropriate for alias analysis calculations. In this patch I have corrected all type size uses except some of those in ScalarReplAggregates, lib/Codegen, lib/Target (the hard cases). I will get around to auditing these too at some point, but I could do with some help. Finally, I made one change which I think wise but others might consider pointless and suboptimal: in an unpacked struct the amount of space allocated for a field is now given by the ABI size rather than getTypeStoreSize. I did this because every other place that reserves memory for a type (eg: alloca) now uses getABITypeSize, and I didn't want to make an exception for unpacked structs, i.e. I did it to make things more uniform. This only effects structs containing long doubles and arbitrary precision integers. If someone wants to pack these types more tightly they can always use a packed struct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43620 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't barf on empty basic blocks. Do not rely on assertDuncan Sands2007-11-011-9/+21
| | | | | | | | | | | doing something - this needs to work for release builds too. I chose to just abort rather than following the fancy logic of abortIfBroken, because (1) it is a pain to do otherwise, and (2) nothing is going to work if the module is this broken. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43611 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence a warning saying that the variables always resolve to "true" in anBill Wendling2007-11-011-4/+4
| | | | | | | expression. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43610 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence, accersed warningBill Wendling2007-11-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43609 91177308-0d34-0410-b5e6-96231b3b80d8
* - Coalesce extract_subreg when both intervals are relatively small.Evan Cheng2007-11-011-23/+46
| | | | | | | - Some code clean up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43606 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test/Transforms/DeadStoreElimination/PartialStore.ll, which had beenOwen Anderson2007-11-011-4/+12
| | | | | | | silently failing because of an incorrect run line for some time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43605 91177308-0d34-0410-b5e6-96231b3b80d8
* remove verifier command line option: this should be part of the API, notChris Lattner2007-11-011-11/+0
| | | | | | | a command line optn. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43603 91177308-0d34-0410-b5e6-96231b3b80d8
* Now with less tabs!Owen Anderson2007-11-011-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43601 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix InstCombine/2007-10-31-StringCrash.ll by removing an obviousChris Lattner2007-11-011-12/+8
| | | | | | | (in hindsight) infinite recursion. Simplify the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43597 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix InstCombine/2007-10-31-RangeCrash.llChris Lattner2007-11-011-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43596 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrote backpatcher. Backpatcher now stores the "has final pointer"Ted Kremenek2007-11-011-21/+19
| | | | | | | | | | | | flag in the **key** of the backpatch map, as opposed to the mapped value which contains either the final pointer, or a pointer to a chain of pointers that need to be backpatched. The bit flag was moved to the key because we were erroneously assuming that the backpatched pointers would be at an alignment of >= 2 bytes, which obviously doesn't work for character strings. Now we just steal the bit from the key. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43595 91177308-0d34-0410-b5e6-96231b3b80d8
* constified several pointer arguments for methods in the Deserializer.Ted Kremenek2007-10-311-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43583 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a regression in test/CodeGen/X86/2007-04-24-VectorCrash.ll introducedDan Gohman2007-10-311-4/+3
| | | | | | | | by r43510. Gracefully handle constants with vector type that aren't ConstantVector or ConstantAggregateZero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43579 91177308-0d34-0410-b5e6-96231b3b80d8