Commit Graph

6035 Commits

Author SHA1 Message Date
Anton Korobeynikov
fd94dd58ff Remove another leak. Due to some reason AliasSetTracker didn't had any dtor...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44320 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 23:52:02 +00:00
Nick Lewycky
c54c561c9f Add new SCEV, SCEVSMax. This allows LLVM to analyze do-while loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44319 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 22:41:31 +00:00
Anton Korobeynikov
d91cbf352a Remove a leak. Destroy LoopInfoBase object. releaseMemory() is actually called in its dtor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44317 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 18:41:39 +00:00
Duncan Sands
827cde1c83 Fix PR1816. If a bitcast of a function only exists because of a
trivial difference in function attributes, allow calls to it to
be converted to direct calls.  Based on a patch by Török Edwin.
While there, move the various lists of mutually incompatible
parameters etc out of the verifier and into ParameterAttributes.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44315 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 14:10:56 +00:00
Chris Lattner
27a6c7380f Several changes:
1) Change the interface to TargetLowering::ExpandOperationResult to 
   take and return entire NODES that need a result expanded, not just
   the value.  This allows us to handle things like READCYCLECOUNTER,
   which returns two values.
2) Implement (extremely limited) support in LegalizeDAG::ExpandOp for MERGE_VALUES.
3) Reimplement custom lowering in LegalizeDAGTypes in terms of the new
   ExpandOperationResult.  This makes the result simpler and fully 
   general.
4) Implement (fully general) expand support for MERGE_VALUES in LegalizeDAGTypes.
5) Implement ExpandOperationResult support for ARM f64->i64 bitconvert and ARM
   i64 shifts, allowing them to work with LegalizeDAGTypes.
6) Implement ExpandOperationResult support for X86 READCYCLECOUNTER and FP_TO_SINT,
   allowing them to work with LegalizeDAGTypes.

LegalizeDAGTypes now passes several more X86 codegen tests when enabled and when
type legalization in LegalizeDAG is ifdef'd out.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44300 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-24 07:07:01 +00:00
Chris Lattner
9e513acd31 Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44296 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23 22:42:31 +00:00
Chris Lattner
c2bfadb9df add some static icmpinst predicates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44283 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-22 23:43:29 +00:00
Duncan Sands
ed4a2f1688 Rename the 'const' parameter attribute to 'readnone',
and the 'pure' parameter attribute to 'readonly'.
Names suggested by DannyB.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44273 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-22 20:23:04 +00:00
Dale Johannesen
526e39a02b File missing from previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44259 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20 23:25:17 +00:00
Dan Gohman
50cdabcfd5 Remove meaningless qualifiers from return types, avoiding compiler warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44240 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19 20:46:23 +00:00
Dan Gohman
ab2a754254 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44235 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19 15:36:19 +00:00
Dan Gohman
adf3eab773 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44234 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19 15:30:20 +00:00
Chris Lattner
2b1f1066ac Fix the Linker testcase regressions, by making MemoryBuffer::getFileOrSTDIN return
a valid but empty buffer if stdin is empty.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44219 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-18 18:52:28 +00:00
Ted Kremenek
247fdca789 Reverted patch 44199:
http://llvm.org/viewvc/llvm-project?rev=44199&view=rev

This patch completely broke serialization due to an invariant I assumed but
did not hold. The assumed invariant was that all pointer IDs emitted by a call
to BatchEmitOwnedPtrs would be consecutive. This is only the case if there has
been no forward references to an owned pointer (and hence already registered
with the Serializer object).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44203 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17 03:34:33 +00:00
Ted Kremenek
07cad1c6ce Changed implementation of Serialize::EmitDiffPtrID and
Deserialize::ReadDiffPtrID to read and emit bools instead of unsigned
integers. This should result in a nice space optimization once we have
"auto-abbreviation" generation in place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44200 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17 00:45:37 +00:00
Ted Kremenek
04ab82a806 Implemented optimization for BatchEmitOwnedPtrs that we only emit one complete
SerializedPtrID, followed by the *differences* in IDs. The big idea is that
most IDs will be just be 1 off from the previous (either that or NULL, which
we encode as a difference if 0), so this will greatly reduce the encoding
space for extra IDs to just 1 bit per pointer.

So far this optimization reduces serialization of Carbon.h by only 1%, but
we aren't using any abbreviations now in the Bitcode file to properly take
advantage of this optimization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44199 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17 00:40:45 +00:00
Evan Cheng
81a0382181 Live interval splitting:
When a live interval is being spilled, rather than creating short, non-spillable
intervals for every def / use, split the interval at BB boundaries. That is, for
every BB where the live interval is defined or used, create a new interval that
covers all the defs and uses in the BB.

This is designed to eliminate one common problem: multiple reloads of the same
value in a single basic block. Note, it does *not* decrease the number of spills
since no copies are inserted so the split intervals are *connected* through
spill and reloads (or rematerialization). The newly created intervals can be
spilled again, in that case, since it does not span multiple basic blocks, it's
spilled in the usual manner. However, it can reuse the same stack slot as the
previously split interval.

This is currently controlled by -split-intervals-at-bb.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44198 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17 00:40:40 +00:00
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