Commit Graph

6018 Commits

Author SHA1 Message Date
Evan Cheng
38b0be01de Shrinkfy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44197 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17 00:31:16 +00:00
Anton Korobeynikov
917c2a6ff2 Implement necessary bits for flt_rounds gcc builtin.
Codegen bits and llvm-gcc support will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44182 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 23:25:33 +00:00
Anton Korobeynikov
4e1a0e386c Reverted r44163 per request
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44177 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 18:33:16 +00:00
Daniel Berlin
07268172ff Fix bugs in iterator invalidation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44174 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 18:06:49 +00:00
Nick Lewycky
65e2da3b4d Fix handling of overflow in loop calculation by adding new UDiv SCEV. This SCEV
is disabled in the sense that it will refuse to create one from a UDiv
instruction, until the code is better tested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44163 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 06:30:50 +00:00
Chris Lattner
ab64806af2 Import the boost scoped_ptr class to LLVM. This patch was prepared by
Cédric Venet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44161 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 05:57:06 +00:00
Owen Anderson
44a95e06cc More templatization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44158 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 05:00:15 +00:00
Ted Kremenek
7c6ad0c06e Fixed serious bug in BatchReadOwnedPtrs where in a chain of calls to
deserialize objects if BatchReadOwnedPtrs was called more than once in the
same call chain then the second call would overwrite the SerializedPtrIDs
being used by the first call. Solved this problem by making the vector that
holds the pointer IDs local to a function call. Now BatchReadOwnedPtrs is
reentrant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44152 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 00:05:03 +00:00
Anton Korobeynikov
0adb7b41e7 Add pure/const attributes. Documentation will follow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44109 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 09:52:30 +00:00
Anton Korobeynikov
9de1934099 Fix PIC jump table codegen on x86-32/linux. In fact, such thing should be applied
to all targets uses GOT-relative offsets for PIC (Alpha?)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44108 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 09:18:41 +00:00
Ted Kremenek
38afd9e3ac Added two new overloaded versions of BatchEmitOwnedPtrs and
BatchReadOwnedPtrs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44105 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 08:05:03 +00:00
Evan Cheng
c498b0281f Clean up sub-register implementation by moving subReg information back to
MachineOperand auxInfo. Previous clunky implementation uses an external map
to track sub-register uses. That works because register allocator uses
a new virtual register for each spilled use. With interval splitting (coming
soon), we may have multiple uses of the same register some of which are
of using different sub-registers from others. It's too fragile to constantly
update the information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44104 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 07:59:08 +00:00
Owen Anderson
019b92a70c Start the process of making MachineLoopInfo possible by templating Loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44097 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 02:33:58 +00:00
Hartmut Kaiser
ffb15de60e Fixed a compilation error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44083 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 23:04:28 +00:00
Hartmut Kaiser
729bd28f62 Fixed a strange construct. Please review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44082 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 23:04:06 +00:00
Owen Anderson
660c5b9514 Wow. I definitely shouldn't write code when I'm tird.
Make my previous patch actually do what it was intended to do.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44061 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 19:56:28 +00:00
Dale Johannesen
b97aec663b Add parameter to getDwarfRegNum to permit targets
to use different mappings for EH and debug info;
no functional change yet.
Fix warning in X86CodeEmitter.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44056 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 19:13:01 +00:00
Bill Wendling
0f8d9c04d9 Unify CALLSEQ_{START,END}. They take 4 parameters: the chain, two stack
adjustment fields, and an optional flag. If there is a "dynamic_stackalloc" in
the code, make sure that it's bracketed by CALLSEQ_START and CALLSEQ_END. If
not, then there is the potential for the stack to be changed while the stack's
being used by another instruction (like a call).

This can only result in tears...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44037 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 00:44:25 +00:00
Ted Kremenek
3ba3a9b586 Renamed serialization method "Materialize" to "Create". This is an API change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44034 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 00:25:08 +00:00
Ted Kremenek
dd479dd3fe Fixed bug with inconsistent serialization/deserialization in matching
calls to BatchEmitOwnedPtrs and BatchReadOwnedPtrs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44032 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 00:13:57 +00:00
Ted Kremenek
62724da930 Added versions of ReadPtr that takes an explicit SerializedPtrID. This allows
clients of the Deserializer to read the pointer ID before they are ready
to deserialize the object (which can mean registering a pointer reference
with the backpatcher).

Changed some methods that took an argument "SerializedPtrID" to "const SerializedPtrID&" (pass-by-reference).  This is to accommodate a future
revision of SerializedPtrID where it may be much fatter than an unsigned
integer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44021 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12 19:11:15 +00:00
Duncan Sands
e923e21364 Compile fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44013 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12 13:43:23 +00:00
Owen Anderson
20ab29068d Add a flag for indirect branch instructions.
Target maintainers: please check that the instructions for your target are correctly marked.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44012 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12 07:39:39 +00:00
Evan Cheng
f2fbca68f8 Refactor some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44010 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12 06:35:08 +00:00
Owen Anderson
e6e1384c57 Fix rewriting of PHI nodes.
Could someone more familiar with machine-level stuff review this for me?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44005 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12 02:13:07 +00:00
Owen Anderson
91a91ffb14 Remove unnecessary #include's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44003 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12 01:19:28 +00:00
Owen Anderson
fe0c882e5a As Chris and Evan pointed out, BreakCriticalMachineEdges doesn't really need
to be a pass of its own.  Instead, move it out into a helper method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44002 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12 01:05:09 +00:00
Ted Kremenek
e7bbd41af2 Fixed a bug introduced by my last patch. Now we properly clear out the BatchIDVec
vector before reusing it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43984 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10 19:33:26 +00:00
Ted Kremenek
303f7fe149 Fixed hack in BatchReadOwnedPtrs to no longer use the array of pointers passed in for
deserialization as a temporary location for storing serialized pointer identifiers. The
definition of SerializedPtrID will likely change significantly in the future, and the
current implementation caused compilation errors on some 64-bit machines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43983 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10 19:28:49 +00:00
Ted Kremenek
1a8a08a690 Added "random access" to the Deserializer to allow a client to jump to any
serialized block in the bitstream, including a block in an entirely different
nesting than the current block. This is useful for deserializing objects from
a bitstream in an order different from the order that they were serialized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43973 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10 02:02:34 +00:00
Ted Kremenek
13faf5c13c Made Deserializer a friend class of BitstreamReader.
Moved some of the logic in BitstreamReader::ExitBlock into a utility function
BitstreamReader::PopBlockScope. The latter is a private method. It will also
be called by Deserializer to manipulate the current "block scope."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43972 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10 02:00:38 +00:00
Duncan Sands
fd617d0143 Move MinAlign to MathExtras.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43944 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 13:41:39 +00:00
Anton Korobeynikov
18d083f0d1 Make this header public
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43938 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 12:16:58 +00:00
Duncan Sands
c6fa170b4d Fix some load/store logic that would be wrong for
apints on big-endian machines if the bitwidth is
not a multiple of 8.  Introduce a new helper,
MVT::getStoreSizeInBits, and use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43934 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 08:57:19 +00:00
Evan Cheng
cc41586b9d Much improved pic jumptable codegen:
Then:
        call    "L1$pb"
"L1$pb":
        popl    %eax
		...
LBB1_1: # entry
        imull   $4, %ecx, %ecx
        leal    LJTI1_0-"L1$pb"(%eax), %edx
        addl    LJTI1_0-"L1$pb"(%ecx,%eax), %edx
        jmpl    *%edx

        .align  2
        .set L1_0_set_3,LBB1_3-LJTI1_0
        .set L1_0_set_2,LBB1_2-LJTI1_0
        .set L1_0_set_5,LBB1_5-LJTI1_0
        .set L1_0_set_4,LBB1_4-LJTI1_0
LJTI1_0:
        .long    L1_0_set_3
        .long    L1_0_set_2

Now:
        call    "L1$pb"
"L1$pb":
        popl    %eax
		...
LBB1_1: # entry
        addl    LJTI1_0-"L1$pb"(%eax,%ecx,4), %eax
        jmpl    *%eax

		.align  2
		.set L1_0_set_3,LBB1_3-"L1$pb"
		.set L1_0_set_2,LBB1_2-"L1$pb"
		.set L1_0_set_5,LBB1_5-"L1$pb"
		.set L1_0_set_4,LBB1_4-"L1$pb"
LJTI1_0:
        .long    L1_0_set_3
        .long    L1_0_set_2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43924 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 01:32:10 +00:00
Ted Kremenek
48a396948f Updated Deserializer class to provide more information about the current
block that is being visited in the bitstream.  The client can also now
skip blocks before reading them, and query the current abbreviation number
as seen from the perspective of the Deserializer.  This allows the client
to be more interactive in the deserialization process (if they so choose).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43916 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 00:43:51 +00:00
Owen Anderson
d195ce1fb6 Make BreakCriticalMachineEdges available as a pass that can be depended on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43910 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 22:20:23 +00:00
Ted Kremenek
ec8cd06555 Added typedef "SerializedPtrID" to represent the pointer handle written to disk
instead of just using "unsigned".  This gives us more flexibility in changing
the definition of the handle later, and is more self-documenting.

Added tracking of block stack in the Deserializer.  Now clients can query
if they are still within a block using the methods GetCurrentBlockLocation()
and FinishedBlock().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43903 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 19:50:46 +00:00
Lauro Ramos Venancio
e0cb36b9fb [ARM] Implement __builtin_thread_pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43892 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 17:20:05 +00:00
Owen Anderson
401f78f8a9 Fix MachineDominators' getAnalysisUsage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43868 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 01:22:53 +00:00
Owen Anderson
fc8663dbe0 Oops, forgot to commit this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43867 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 01:22:24 +00:00
Ted Kremenek
43b665db50 Revised BatchEmitOwnedPtrs to work better with constant pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43861 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 00:55:31 +00:00
Ted Kremenek
6d0372d0b3 Revised implementation of BatchReadOwnedPtrs() that deserializes an
array of pointers to not allocate a second array to contain the pointer ids.

Fixed bug in the same member function where deserialized pointers were
not being registered with the backpatcher.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43855 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 00:04:50 +00:00
Ted Kremenek
3b46b6df91 Fixed bug where we did not properly serialize owned objects due to a missing
dereference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43853 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-07 23:32:06 +00:00
Ted Kremenek
fba9cdaa81 Added version of BatchEmitOwnedPtrs and BatchReadOwnedPtrs that emits/reads
an array of pointers of the same type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43852 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-07 23:18:40 +00:00
Ted Kremenek
6d8ab4ae81 Added methods to batch emit and deserialize owned pointers. This allows
to group the pointer IDs together in the bitstream before their referenced
contents (which will lend itself to more efficient encoding).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43845 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-07 22:30:29 +00:00
Hartmut Kaiser
a1dc96edd2 Fixed compilation errors on VC++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43836 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-07 19:33:31 +00:00
Ted Kremenek
c47dfdde24 Implemented generic serialization of APFloat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43829 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-07 18:39:22 +00:00
Ted Kremenek
2e6452ca0c Implemented serialization of signed integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43828 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-07 18:24:34 +00:00
Ted Kremenek
18b5ddb5bf Added special version of ReadPtr() that returns a deserialized pointer
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
2007-11-07 00:47:33 +00:00