aboutsummaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Added special version of ReadPtr() that returns a deserialized pointerTed Kremenek2007-11-071-1/+4
| | | | | | | | by value. This version prohibits backpatching of pointers, so it useful when a pointee is always known to be deserialized beforehand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43799 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed default ctor for APInt to properly initialize BitWidth to aTed Kremenek2007-11-071-1/+1
| | | | | | | non-random value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43795 91177308-0d34-0410-b5e6-96231b3b80d8
* Serializer no longer automatically emits a root-level block in the bitstream.Ted Kremenek2007-11-061-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43784 91177308-0d34-0410-b5e6-96231b3b80d8
* Augmented ReadPtr and ReadOwnedPtr to control whether or not a pointer is ↵Ted Kremenek2007-11-061-9/+12
| | | | | | | | | allowed to be backpatched or can be registered with the deserializer to backpatch other pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43783 91177308-0d34-0410-b5e6-96231b3b80d8
* make smallptrset more const and type correct, which caught a fewChris Lattner2007-11-061-13/+28
| | | | | | | minor bugs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43782 91177308-0d34-0410-b5e6-96231b3b80d8
* Renamed "Flush()" to "FlushRecord()".Ted Kremenek2007-11-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43772 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support for processing abbreviations in the Deserializer.Ted Kremenek2007-11-061-1/+1
| | | | | | | Added some #ifdef-controlled messages for debugging backpatching. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43771 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the LowerMEMCPY and LowerMEMCPYCall to a common place.Rafael Espindola2007-11-052-0/+19
| | | | | | | | 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-1/+6
| | | | | | | 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
* Added default creation of root-level block by bitstream serializer.Ted Kremenek2007-11-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43732 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed bug where tombstone key and empty key for DenseMap used forTed Kremenek2007-11-052-2/+4
| | | | | | | | pointer backpatching in deserializer were improperly created and resulted in an assertion failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43721 91177308-0d34-0410-b5e6-96231b3b80d8
* Move SimpleRegisterCoalescing.h to lib/CodeGen since there is now a commonEvan Cheng2007-11-051-180/+0
| | | | | | | register coalescer interface: RegisterCoalescing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43714 91177308-0d34-0410-b5e6-96231b3b80d8
* Deleting redundant copy of block extractor pass. See also PR1775.Gordon Henriksen2007-11-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43694 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the remaining uses of getTypeSize. ThisDuncan Sands2007-11-052-10/+2
| | | | | | | | | | | | | | | 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
* Change uses of getTypeSize to getABITypeSize, getTypeStoreSizeDuncan Sands2007-11-041-1/+5
| | | | | | | | | | | | | | | | | | | | | | | 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
* There are times when the coalescer would not coalesce away a copy but the copyEvan Cheng2007-11-031-0/+5
| | | | | | | | | | | | | | | | | 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
* Added overloaded version of Deserializer::ReadOwnedPtr which allowsTed Kremenek2007-11-021-0/+5
| | | | | | | | | the target pointer to be passed by reference. This can result in less typing, as the object to be deserialized can be inferred from the argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43647 91177308-0d34-0410-b5e6-96231b3b80d8
* VAArgInst does, in fact, read memory.Owen Anderson2007-11-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43633 91177308-0d34-0410-b5e6-96231b3b80d8
* When converting to integer, do bit manipulations in the destinationNeil Booth2007-11-011-0/+2
| | | | | | | | | | | | | 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-012-8/+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-011-16/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Get rid of compilation warning during release buildsBill Wendling2007-11-011-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43608 91177308-0d34-0410-b5e6-96231b3b80d8
* - Coalesce extract_subreg when both intervals are relatively small.Evan Cheng2007-11-011-5/+5
| | | | | | | - Some code clean up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43606 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrote backpatcher. Backpatcher now stores the "has final pointer"Ted Kremenek2007-11-011-32/+48
| | | | | | | | | | | | 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
* Added typedef "value_type" to DenseMap (similar typedef appears in std::map).Ted Kremenek2007-11-011-5/+11
| | | | | | | | | | | | | Added method FindAndConstruct() to DenseMap, which does the same thing as operator[], except that it refers value_type& (a reference to both the key and mapped data pair). This method is useful for clients that wish to access the stored key value, as opposed to the key used to do the actual lookup (these need not always be the same). Redefined operator[] to use FindAndConstruct() (same logic). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43594 91177308-0d34-0410-b5e6-96231b3b80d8
* constified several pointer arguments for methods in the Deserializer.Ted Kremenek2007-10-311-2/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43583 91177308-0d34-0410-b5e6-96231b3b80d8
* Implemented deserialization of references. References are handledTed Kremenek2007-10-311-5/+21
| | | | | | | | | | | | | | just like pointers, except that they cannot be backpatched. This means that references are essentially non-owning pointers where the referred object must be deserialized prior to the reference being deserialized. Because of the nature of references, this ordering of objects is always possible. Fixed a bug in backpatching code (returning the backpatched pointer would accidentally include a bit flag). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43570 91177308-0d34-0410-b5e6-96231b3b80d8
* Added Serializer::EmitRef to deal with emitting arbitrary references.Ted Kremenek2007-10-311-3/+6
| | | | | | | Modified Serializer::EmitPtr to handle const pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43565 91177308-0d34-0410-b5e6-96231b3b80d8
* Changed access control within FoldingSet for some ivars from "private"Ted Kremenek2007-10-311-1/+1
| | | | | | | to "protected". This allows iterators to work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43559 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a newline at the end of the file.Duncan Sands2007-10-311-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43550 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the skeleton of a better PHI elimination pass.Owen Anderson2007-10-311-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43542 91177308-0d34-0410-b5e6-96231b3b80d8
* Some fixes to get MachineDomTree working better.Owen Anderson2007-10-313-18/+38
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43541 91177308-0d34-0410-b5e6-96231b3b80d8
* Added member function "size()" to FoldingSet to return the number ofTed Kremenek2007-10-301-1/+4
| | | | | | | nodes in the FoldingSet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43531 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing SSE builtins: CVTPD2PI, CVTPS2PI,Dale Johannesen2007-10-301-0/+13
| | | | | | | | CVTTPD2PI, CVTTPS2PI, CVTPI2PD, CVTPI2PS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43523 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix argument types for PSLLQ, PSRLQ.Dale Johannesen2007-10-301-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43490 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable more fold (sext (load x)) -> (sext (truncate (sextload x)))Evan Cheng2007-10-291-0/+4
| | | | | | | | | transformation. Previously, it's restricted by ensuring the number of load uses is one. Now the restriction is loosened up by allowing setcc uses to be "extended" (e.g. setcc x, c, eq -> setcc sext(x), sext(c), eq). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43465 91177308-0d34-0410-b5e6-96231b3b80d8
* Add explicit keywords.Dan Gohman2007-10-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43464 91177308-0d34-0410-b5e6-96231b3b80d8
* Model stacksave and stackrestore as both writing memory, since we Chris Lattner2007-10-291-1/+4
| | | | | | | | don't model their dependences on allocas correctly. This fixes PR1745. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43442 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a first attempt at dominator information for MBB's. Use with caution: ↵Owen Anderson2007-10-292-7/+177
| | | | | | this has been tested to compile. It has not yet been confirmed to generate correct analysis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43438 91177308-0d34-0410-b5e6-96231b3b80d8
* Updated backpatching logic during object deserialization to performTed Kremenek2007-10-281-19/+53
| | | | | | | | | eager backpatching instead of waithing until all objects have been deserialized. This allows us to reduce the memory footprint needed for backpatching. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43422 91177308-0d34-0410-b5e6-96231b3b80d8
* The guaranteed alignment of ptr+offset is only the minimum ofDuncan Sands2007-10-281-0/+28
| | | | | | | | | | | | | | | | | | | | of offset and the alignment of ptr if these are both powers of 2. While the ptr alignment is guaranteed to be a power of 2, there is no reason to think that offset is. For example, if offset is 12 (the size of a long double on x86-32 linux) and the alignment of ptr is 8, then the alignment of ptr+offset will in general be 4, not 8. Introduce a function MinAlign, lifted from gcc, for computing the minimum guaranteed alignment. I've tried to fix up everywhere under lib/CodeGen/SelectionDAG/. I also changed some places that weren't wrong (because both values were a power of 2), as a defensive change against people copying and pasting the code. Hopefully someone who cares about alignment will review the rest of LLVM and fix up the remaining places. Since I'm on x86 I'm not very motivated to do this myself... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43421 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed bug where default SerializeTrait<>::Materialize would not return the ↵Ted Kremenek2007-10-261-1/+1
| | | | | | materialized object pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43413 91177308-0d34-0410-b5e6-96231b3b80d8
* Added serialization support for APInt.Ted Kremenek2007-10-261-0/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43405 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed incorrect "path name" in preamble (comment) of header file.Ted Kremenek2007-10-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43402 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed incorrect "path name" in preamble (comment) of header file.Ted Kremenek2007-10-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43401 91177308-0d34-0410-b5e6-96231b3b80d8
* Added default implementation of SerializeTrait<> that dispatches toTed Kremenek2007-10-262-1/+25
| | | | | | | | | | | calling member functions of the target type to perform type-specific serialization. Added version of ReadPtr that allows passing references to uintptr_t (useful for smart pointers). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43396 91177308-0d34-0410-b5e6-96231b3b80d8
* More fleshing out of docs/Passes.html, plus some typo fixes andGordon Henriksen2007-10-261-1/+1
| | | | | | improved wording in source files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43377 91177308-0d34-0410-b5e6-96231b3b80d8
* Loosen up iv reuse to allow reuse of the same stride but a larger type when ↵Evan Cheng2007-10-261-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | truncating from the larger type to smaller type is free. e.g. Turns this loop: LBB1_1: # entry.bb_crit_edge xorl %ecx, %ecx xorw %dx, %dx movw %dx, %si LBB1_2: # bb movl L_X$non_lazy_ptr, %edi movw %si, (%edi) movl L_Y$non_lazy_ptr, %edi movw %dx, (%edi) addw $4, %dx incw %si incl %ecx cmpl %eax, %ecx jne LBB1_2 # bb into LBB1_1: # entry.bb_crit_edge xorl %ecx, %ecx xorw %dx, %dx LBB1_2: # bb movl L_X$non_lazy_ptr, %esi movw %cx, (%esi) movl L_Y$non_lazy_ptr, %esi movw %dx, (%esi) addw $4, %dx incl %ecx cmpl %eax, %ecx jne LBB1_2 # bb git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43375 91177308-0d34-0410-b5e6-96231b3b80d8
* Updated backpatching during object deserialization to support "smart"Ted Kremenek2007-10-251-2/+6
| | | | | | | pointers that employ unused bits in a pointer to store extra data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43373 91177308-0d34-0410-b5e6-96231b3b80d8
* Added special treatment of serializing NULL pointers.Ted Kremenek2007-10-252-1/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43357 91177308-0d34-0410-b5e6-96231b3b80d8