Commit Graph

5946 Commits

Author SHA1 Message Date
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