Commit Graph

6018 Commits

Author SHA1 Message Date
Ted Kremenek
586504d5ed Fixed default ctor for APInt to properly initialize BitWidth to a
non-random value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43795 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-07 00:27:59 +00:00
Ted Kremenek
68dd3fbe5b Serializer no longer automatically emits a root-level block in the bitstream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43784 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06 22:22:25 +00:00
Ted Kremenek
b12a82dbf4 Augmented ReadPtr and ReadOwnedPtr to control whether or not a pointer is 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
2007-11-06 22:21:14 +00:00
Chris Lattner
373a733be0 make smallptrset more const and type correct, which caught a few
minor bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43782 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06 22:12:43 +00:00
Ted Kremenek
730c273d42 Renamed "Flush()" to "FlushRecord()".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43772 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06 19:49:50 +00:00
Ted Kremenek
26e25b3bf0 Added support for processing abbreviations in the Deserializer.
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
2007-11-06 19:49:16 +00:00
Rafael Espindola
f1ba1cad38 Move the LowerMEMCPY and LowerMEMCPYCall to a common place.
Thanks for the suggestions Bill :-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43742 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05 23:12:20 +00:00
Ted Kremenek
0a6d98e10e Added support in serializer and deserializer to create arbitrary blocks.
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
2007-11-05 21:36:35 +00:00
Ted Kremenek
14ac17e2df Added default creation of root-level block by bitstream serializer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43732 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05 20:47:27 +00:00
Ted Kremenek
6fd11c53e9 Fixed bug where tombstone key and empty key for DenseMap used for
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
2007-11-05 18:13:03 +00:00
Evan Cheng
a461c4d75b Move SimpleRegisterCoalescing.h to lib/CodeGen since there is now a common
register coalescer interface: RegisterCoalescing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43714 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05 17:41:38 +00:00
Gordon Henriksen
4e1be6d5ea Deleting redundant copy of block extractor pass. See also PR1775.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43694 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05 01:54:05 +00:00
Duncan Sands
ca0ed74485 Eliminate the remaining uses of getTypeSize. This
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
2007-11-05 00:04:43 +00:00
Duncan Sands
3cb3650a27 Change uses of getTypeSize to getABITypeSize, getTypeStoreSize
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
2007-11-04 14:43:57 +00:00
Evan Cheng
c92da3882e There are times when the coalescer would not coalesce away a copy but the copy
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
2007-11-03 07:20:12 +00:00
Ted Kremenek
24384d1d1e Added overloaded version of Deserializer::ReadOwnedPtr which allows
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
2007-11-02 18:04:20 +00:00
Owen Anderson
1ef14f6e76 VAArgInst does, in fact, read memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43633 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-02 04:01:21 +00:00
Neil Booth
ee7ae384f5 When converting to integer, do bit manipulations in the destination
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
2007-11-01 22:43:37 +00:00
Ted Kremenek
ff37ccc570 Removed ReadVal from SerializeTrait<T>, and also removed it from
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
2007-11-01 22:23:34 +00:00
Duncan Sands
514ab348fd Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.
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
2007-11-01 20:53:16 +00:00
Bill Wendling
651dfd1ff8 Get rid of compilation warning during release builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43608 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 08:24:40 +00:00
Evan Cheng
0547bab214 - Coalesce extract_subreg when both intervals are relatively small.
- Some code clean up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43606 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 06:22:48 +00:00
Ted Kremenek
066ff5b7f2 Rewrote backpatcher. Backpatcher now stores the "has final pointer"
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
2007-11-01 00:57:37 +00:00
Ted Kremenek
aef806e9cb Added typedef "value_type" to DenseMap (similar typedef appears in std::map).
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
2007-11-01 00:54:57 +00:00
Ted Kremenek
a7963a59b3 constified several pointer arguments for methods in the Deserializer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43583 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 22:42:03 +00:00
Ted Kremenek
eb9409dbb9 Implemented deserialization of references. References are handled
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
2007-10-31 19:58:32 +00:00
Ted Kremenek
8aac61cff0 Added Serializer::EmitRef to deal with emitting arbitrary references.
Modified Serializer::EmitPtr to handle const pointers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43565 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 18:23:21 +00:00
Ted Kremenek
8092406e59 Changed access control within FoldingSet for some ivars from "private"
to "protected".  This allows iterators to work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43559 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 17:12:47 +00:00
Duncan Sands
1bd3271b16 Add a newline at the end of the file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43550 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 08:49:24 +00:00
Owen Anderson
0bda0e8895 Add the skeleton of a better PHI elimination pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43542 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 03:37:57 +00:00
Owen Anderson
5d32ec4cb0 Some fixes to get MachineDomTree working better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43541 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 03:30:14 +00:00
Ted Kremenek
20b7907c1c Added member function "size()" to FoldingSet to return the number of
nodes in the FoldingSet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43531 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 23:35:55 +00:00
Dale Johannesen
c784208a73 Add missing SSE builtins: CVTPD2PI, CVTPS2PI,
CVTTPD2PI, CVTTPS2PI, CVTPI2PD, CVTPI2PS.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43523 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 22:15:38 +00:00
Dale Johannesen
6e3a8f3dfb Fix argument types for PSLLQ, PSRLQ.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43490 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 01:44:33 +00:00
Evan Cheng
3c3ddb3a85 Enable more fold (sext (load x)) -> (sext (truncate (sextload x)))
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
2007-10-29 19:58:20 +00:00
Dan Gohman
9962054775 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43464 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 19:52:04 +00:00
Chris Lattner
cee291c505 Model stacksave and stackrestore as both writing memory, since we
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
2007-10-29 05:47:52 +00:00
Owen Anderson
08895f8866 Add a first attempt at dominator information for MBB's. Use with caution: 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
2007-10-29 04:50:50 +00:00
Ted Kremenek
5973ef40ca Updated backpatching logic during object deserialization to perform
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
2007-10-28 21:17:59 +00:00
Duncan Sands
dc84650679 The guaranteed alignment of ptr+offset is only the minimum of
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
2007-10-28 12:59:45 +00:00
Ted Kremenek
d9c8822fb3 Fixed bug where default SerializeTrait<>::Materialize would not return the materialized object pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43413 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 23:44:59 +00:00
Ted Kremenek
1a43e5ffe1 Added serialization support for APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43405 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 21:50:10 +00:00
Ted Kremenek
7f46734b66 Fixed incorrect "path name" in preamble (comment) of header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43402 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 20:44:02 +00:00
Ted Kremenek
02760ed19a Fixed incorrect "path name" in preamble (comment) of header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43401 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 20:42:45 +00:00
Ted Kremenek
6a13dfdc6d Added default implementation of SerializeTrait<> that dispatches to
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
2007-10-26 20:23:27 +00:00
Gordon Henriksen
55cbec317d More fleshing out of docs/Passes.html, plus some typo fixes and
improved wording in source files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43377 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 03:03:51 +00:00
Evan Cheng
2bd122c4d9 Loosen up iv reuse to allow reuse of the same stride but a larger type when 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
2007-10-26 01:56:11 +00:00
Ted Kremenek
3bd9dcc08f Updated backpatching during object deserialization to support "smart"
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
2007-10-25 23:40:35 +00:00
Ted Kremenek
2423e03ca8 Added special treatment of serializing NULL pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43357 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 18:42:52 +00:00
Ted Kremenek
3b8ac40e63 Created header file to include minimal forward references needed for
object serialization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43352 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 18:19:29 +00:00
Duncan Sands
b36904be91 Fix comment typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43338 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 12:28:12 +00:00
Chris Lattner
33819d9704 remove unimplemented ctor, add some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43328 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 05:19:24 +00:00
Owen Anderson
4d6d5783d8 Make it possible for DomTreeBase to be constructed from MachineFunction's as well as just Function's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43321 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 00:16:57 +00:00
Ted Kremenek
fe2a012338 Implemented prototype serialization of pointers, including support
for backpatching.

Added Deserialize::ReadVal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43319 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 00:10:21 +00:00
Ted Kremenek
6e9b496643 Split Serialization.h into separate headers: Serialize.h and
Deserialize.h Serialization.h now includes trait speciailizations for
unsigned long, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43307 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 19:06:40 +00:00
Chris Lattner
10c42185d8 add a nice predicate to check to see if nan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43304 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 18:54:28 +00:00
Hartmut Kaiser
4d40b50743 Silenced a VC++ warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43276 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:06:31 +00:00
Ted Kremenek
211f674e3f Added "ReadEnum" and "WriteEnum" to serialization classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43265 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 22:17:03 +00:00
Owen Anderson
7feb3be0b7 Make DomTreeBase not a FunctionPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43263 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 21:42:49 +00:00
Ted Kremenek
0b2d7aaf5c Added preliminary implementation of generic object serialization to bitcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43261 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 21:29:33 +00:00
Owen Anderson
78daec973e Unbreak the build. Forgot to commit this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43260 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 21:04:37 +00:00
Owen Anderson
d20cc14dbf Make DomTree and PostDomTree thin wrappers around DomTreeBase, rather than inheriting from it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43259 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 20:58:37 +00:00
Evan Cheng
e11fb34381 isSubRegOf() is a dup of isSubRegister.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43249 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 06:51:50 +00:00
Dan Gohman
246b2564d3 Move the SCEV object factors from being static members of the individual
SCEV subclasses to being non-static member functions of the ScalarEvolution
class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43224 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 18:31:58 +00:00
Chris Lattner
d958a5a9fe add a mechanism for the JIT to invoke a function to lazily create functions as they are referenced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43210 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 02:50:12 +00:00
Anton Korobeynikov
a024e8ceda Reg2Mem cleanup and optimizations:
- enable phi instructions demotion to stack
 - create alloca instructions in the entry block


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43208 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-21 23:05:16 +00:00
Chris Lattner
8b5295b7bb Add a convenience method for creating EE's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43206 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-21 22:57:11 +00:00
Evan Cheng
66f7163545 Local spiller optimization:
Turn a store folding instruction into a load folding instruction. e.g.
     xorl  %edi, %eax
     movl  %eax, -32(%ebp)
     movl  -36(%ebp), %eax
     orl   %eax, -32(%ebp)
=>
     xorl  %edi, %eax
     orl   -36(%ebp), %eax
     mov   %eax, -32(%ebp)
This enables the unfolding optimization for a subsequent instruction which will
also eliminate the newly introduced store instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43192 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 21:23:22 +00:00
Chris Lattner
1c4d492b94 rename ExpandOperation to ExpandOperationResult, as suggested
by Duncan


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43177 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 15:28:47 +00:00
Rafael Espindola
5c0d6ed325 Add support for byval function whose argument is not 32 bit aligned.
To do this it is necessary to add a "always inline" argument to the
memcpy node. For completeness I have also added this node to memmove
and memset.  I have also added getMem* functions, because the extra
argument makes it cumbersome to use getNode and because I get confused
by it :-)




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43172 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 10:41:11 +00:00
Chris Lattner
f58dac3169 add a new target hook.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43165 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 03:31:45 +00:00
Dale Johannesen
fabd32deb0 More ppcf128 issues (maybe the last)?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43160 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 00:59:18 +00:00
Evan Cheng
f0a0cddbcd - Added getOpcodeAfterMemoryUnfold(). It doesn't unfold an instruction, but only returns the opcode of the instruction post unfolding.
- Fix some copy+paste bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43153 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 22:40:57 +00:00
Evan Cheng
58184e6878 Use SmallVectorImpl instead of SmallVector with hardcoded size in MRegister public interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43150 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 21:29:24 +00:00
Christopher Lamb
c5ccbdbe32 Add an uppercase conversion utility function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43146 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 19:31:38 +00:00
Chris Lattner
a0d9de0b66 remove dead file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43131 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 16:12:54 +00:00
Chris Lattner
44b38f2e2c update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43128 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 16:10:17 +00:00
Gordon Henriksen
9bb4ea03be Missing 'public' keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43121 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 11:31:21 +00:00
Evan Cheng
4ae31a5d32 Really fix PR1734. Carefully track which register uses are sub-register uses by
traversing inverse register coalescing map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43118 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 07:49:59 +00:00
Evan Cheng
cf1d7256d0 Remove unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43117 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 07:47:55 +00:00
Owen Anderson
7b714321df Move Split<...>() into DomTreeBase. This should make the #include's of DominatorInternals.h
in CodeExtractor and LoopSimplify unnecessary.

Hartmut, could you confirm that this fixes the issues you were seeing?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43115 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 05:13:52 +00:00
Ted Kremenek
52e2d83e65 Changed the return type of type-specific Allocate() methods to return
void*.  This is hint that we are returning uninitialized memory rather
than a constructed object.

Patched ImutAVLTree to conform to this new interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43106 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 00:30:14 +00:00
Ted Kremenek
fa4710427f ImutAVLTree now allocates tree nodes from the BumpPtrAllocator using
the new type-aligned Allocate() method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43100 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 22:17:01 +00:00
Ted Kremenek
129d7d3bde Removed inclusion of cassert, which is no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43099 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 22:12:14 +00:00
Ted Kremenek
6740463c74 Minor cosmetic cleanups in the calculation of alignments for
StringMapEntry objects.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43097 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 22:09:45 +00:00
Ted Kremenek
87f3870db9 Added template function alignof() which provides a clean
function-based interface to getting the alignment of a type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43096 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 22:08:55 +00:00
Gordon Henriksen
4b2b9402c5 Switching TargetMachineRegistry to use the new generic Registry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43094 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 21:28:48 +00:00
Ted Kremenek
9080aaba0b Updated StringMap to use llvm::AlignOf to compute the alignment of map
entries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43089 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 21:13:50 +00:00
Ted Kremenek
869a3344f1 Added member template functions to MallocAllocator and
BumpPtrAllocator that implement allocations that return a properly
typed pointer.  For BumpPtrAllocator, the allocated memory is
automatically aligned to the minimum alignment of the type (as
calculated by llvm::AlignOf::Alignment).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43087 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 21:10:21 +00:00
Ted Kremenek
a4d9869cf2 Added llvm::AlignOf, a template class whose purpose is to portably
compute the minimum memory alignment of arbitrary types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43086 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 20:56:47 +00:00
Dan Gohman
3b7cf0aaba Define a helper function ConstantVector::getSplatValue for testing for
and working with broadcasted constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 17:51:30 +00:00
Hartmut Kaiser
efd4a5144b Updated VC++ build system.
Silenced some VC warnings.

I'm getting linker errors, though: unresolved externals:

llvm::Split<class llvm::BasicBlock *,struct llvm::GraphTraits<class llvm::BasicBlock *> >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *)

and

llvm::Split<struct llvm::Inverse<class llvm::BasicBlock *>,struct llvm::GraphTraits<struct llvm::Inverse<class llvm::BasicBlock *> > >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *)

Where are these defined?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 14:56:40 +00:00
Duncan Sands
f411b83c8c Return Expand from getOperationAction for all extended
types.  This is needed for SIGN_EXTEND_INREG at least.
It is not clear if this is correct for other operations.
On the other hand, for the various load/store actions
it seems to correct to return the type action, as is
currently done.
Also, it seems that SelectionDAG::getValueType can be
called for extended value types; introduce a map for
holding these, since we don't really want to extend
the vector to be 2^32 pointers long!
Generalize DAGTypeLegalizer::PromoteResult_TRUNCATE
and DAGTypeLegalizer::PromoteResult_INT_EXTEND to handle
the various funky possibilities that apints introduce,
for example that you can promote to a type that needs
to be expanded.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43071 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 13:49:58 +00:00
Evan Cheng
a5bfc97da7 Apply Chris' suggestions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43069 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 06:53:44 +00:00
Evan Cheng
28e9a5fe94 Update comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43064 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 02:16:40 +00:00
Evan Cheng
4ca980e7f9 Clean up code that calculate MBB live-in's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43060 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 02:10:22 +00:00
Owen Anderson
05d2318fbd Move splitBlock into DomTreeBase from DomTree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43059 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 02:03:17 +00:00
Owen Anderson
280f8a2ece Fix some formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43049 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 22:59:15 +00:00
Owen Anderson
49b653aa6a Template DominatorTreeBase by node type. This is the next major step towards
having dominator information on MBB's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43036 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 19:59:25 +00:00
Duncan Sands
67c18d5034 Document the fact that the verifier currently requires the
top bit of a ValueType to be zero.  Enforce this by ensuring
an assertion failure if someone tries to create a ValueType
without this property.  I chose this minimal approach rather
than a more official integration of the notion of reserved
bits into ValueType because I'm hoping that the verifier will
be changed to no longer require this :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43031 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 13:34:11 +00:00