Commit Graph

7130 Commits

Author SHA1 Message Date
Dan Gohman
cddc11e757 Add a utility function to MachineInstr for testing whether an instruction
has exactly one MachineMemOperand, and change some X86 lowering code to
make use of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53498 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-12 00:10:52 +00:00
Dan Gohman
e6acf36dca Fix spelling of "hierarchy" in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53489 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 22:51:32 +00:00
Dan Gohman
e4f1a7e8ff Fix typos in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53487 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 22:48:20 +00:00
Dan Gohman
a54cf17661 Include a frame index in the "fixed stack" pseudo source value
instead of using the frame index for the SVOffset, which was
inconsistent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53486 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 22:44:52 +00:00
Ted Kremenek
eca64f0980 Minor tweaks to the ImmutableList iterator interface.
Added partial specialization of DenseMapInfo<T> for ImmutableList.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53485 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 22:43:07 +00:00
Dan Gohman
dbe2a5a269 Add support for putting NamedRegionTimers in TimerGroups, and
use a timer group for the timers in SelectionDAGISel. Also,
Split scheduling out from emitting, to give each their own
timer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53476 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 21:54:34 +00:00
Dan Gohman
c418bf3dd5 Use find instead of lower_bound.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53474 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 20:58:19 +00:00
Dan Gohman
dc2fbddd9d Trim unnecessary #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53471 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 20:38:31 +00:00
Duncan Sands
ac6cecec18 It is pointless to turn a UINT_TO_FP into an
SINT_TO_FP libcall plus additional operations:
it might as well be a direct UINT_TO_FP libcall.
So only turn it into an SINT_TO_FP if the target
has special handling for SINT_TO_FP.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 17:00:14 +00:00
Duncan Sands
9bed0f58eb Add two missing SINT_TO_FP libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53460 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 16:57:02 +00:00
Duncan Sands
dddc6291fb Add support for 128 bit shifts and 32 bit shifts
on 16 bit machines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53458 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 16:52:29 +00:00
Ted Kremenek
0ebf14c4bb Make typedef public to make MSVC++ happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53433 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 23:24:20 +00:00
Ted Kremenek
3000357ab5 Make some typedefs public to make MSVC++ happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53432 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 23:09:45 +00:00
Ted Kremenek
ccaa6540fc Make typedefs in ilist public (Visual C++ errors out when they are private).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53431 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 22:58:10 +00:00
Bill Wendling
98fd7f6b2f Pull r53428 from Gaz into mainline:
Remove warnings about unused/shadowed variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53430 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 22:57:49 +00:00
Ted Kremenek
07f3cf76c6 Added ImmutableMap constructor that accepts a const TreeTy*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 22:57:10 +00:00
Dan Gohman
4f4b348437 Tidy up #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53426 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 22:26:19 +00:00
Dan Gohman
ea8a8651fa Add a SubclassData field to SDNode, similar to what's done
in Value, to make use of some otherwise unused space. Use this
field to shrink LoadSDNode and StoreSDNode by moving the
addressing mode and ext/trunc fields there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53422 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 21:44:59 +00:00
Dan Gohman
90b58e0317 Fix a copy+pasto in an assertion string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53419 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 19:58:23 +00:00
Dan Gohman
46e7730c81 Stack objects have nonnegative indices, not just positive indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53418 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 19:57:25 +00:00
Dan Gohman
358f5ac972 Escape the graph name. This unbreaks -view-cfg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53417 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 19:55:54 +00:00
Dan Gohman
1bf85e569b Remove this file; the code that it went with is no longer
in the repository.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53416 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 19:55:04 +00:00
Duncan Sands
5ac319ac71 Add support for 128 bit multiplicative operations.
Lack of these caused a bootstrap failure with Fortran
on x86-64 with LegalizeTypes turned on.  While there,
be nice to 16 bit machines and support expansion of
i32 too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53408 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 15:35:05 +00:00
Duncan Sands
be1ad4de29 Add a mysteriously missing libcall, FPTOSINT_F80_I32.
Be nice to 16 bit machines by supporting FP_TO_XINT
expansion for these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53407 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 15:33:02 +00:00
Duncan Sands
df99c29e7b Correct a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53401 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 11:21:59 +00:00
Evan Cheng
ef0732d25a - Change the horrible N^2 isRegReDefinedByTwoAddr. Now callers must supply the operand index of def machineoperand and at most one full scan of non-implicit operands is needed.
- Change local register allocator to use the new isRegReDefinedByTwoAddr instead of reinventing the wheel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 07:35:43 +00:00
Chris Lattner
cd4e5b0417 add a helper method for code that wants to handle vector
constants by element without caring how they are formed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53382 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 00:28:34 +00:00
Evan Cheng
250c1d8734 - Replace use of std::map<std::string, ..> with StringMap. Replace use of std::map with DenseMap, std::set with SmallPtrSet. This results in minor speed up.
- Some code clean up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53379 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 00:04:23 +00:00
Dan Gohman
b9c33c3229 Simplify hasNUsesOfValue and hasAnyUsesOfValue even more. This
makes their special-case checks of use_size() less beneficial,
so remove them. This eliminates all but one use of use_size(),
which is in AssignTopologicalOrder, which uses it only once for
each node, and so can reasonably afford to recompute it, as
this allows the UsesSize field of SDNode to be removed
altogether.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53377 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 23:03:14 +00:00
Dan Gohman
1ea58a52a4 Move MemoryVT out of LSBaseNode into MemSDNode, allowing the
getMemOperand function to be moved into the base class as well
and made non-virtual.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53372 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 22:08:04 +00:00
Dan Gohman
492f276cbc Move the IsVolatile and SVOffset fields into the MemSDNode base
class, and store IsVolatile and Alignment in a more compact form.
This makes AtomicSDNode slightly larger, but it shrinks LoadSDNode
and StoreSDNode, which are much more common and are the largest of
the SDNode subclasses. Also, this lets the isVolatile() and
getAlignment() accessors be non-virtual.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53361 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 21:23:02 +00:00
Anton Korobeynikov
8e819aea34 Silence a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53326 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:56:43 +00:00
Anton Korobeynikov
4b4d100ad0 Drop enum and use constants for SectionFlags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53325 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:41:07 +00:00
Anton Korobeynikov
0d44ba82b4 First sketch of special section objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53320 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:28:49 +00:00
Anton Korobeynikov
93911d239b Unbreak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53317 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:27:37 +00:00
Anton Korobeynikov
7e7fc82cf3 Another bunch of hacks for named sections support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53315 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:26:52 +00:00
Anton Korobeynikov
b20015b621 Add hacky way to distinguish named and named sections. This will be generalized in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53311 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:25:26 +00:00
Anton Korobeynikov
01b0e24c25 Handle ELF mergeable sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53306 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:23:37 +00:00
Anton Korobeynikov
265c5259ab Provide general hook for section name calculation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53304 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:22:46 +00:00
Anton Korobeynikov
6d82942092 Print entity size for mergeable sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53303 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:22:17 +00:00
Anton Korobeynikov
6e405f3f77 Move flag decoding stuff into special hook
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53297 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:20:07 +00:00
Anton Korobeynikov
29b03f7375 Properly handle linkonce stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53296 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:19:38 +00:00
Anton Korobeynikov
c0f41db19c Provide skeletone code for calculation of section, where global should be emitted into
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53295 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:19:08 +00:00
Anton Korobeynikov
5555078960 Make hooks virtual
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53293 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:18:21 +00:00
Anton Korobeynikov
0c602469f4 Add default section name resolution routine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53292 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:18:02 +00:00
Anton Korobeynikov
8cc948d228 Constify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53291 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:17:36 +00:00
Anton Korobeynikov
beb9d40900 Add code for default section falgs computation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53290 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:16:59 +00:00
Chris Lattner
6fa6a32e4e Add a little wrapper header that is put around bc files when emitting
bc files for modules with a target triple that indicates they are for
darwin.  The reader unconditionally handles this, and the writer could
turn this on for more targets if we care.

This change has two benefits for darwin:

1) it allows us to encode the cpu type of the file in an easy to read
   place that doesn't require decoding the bc file.
2) it works around a bug (IMO) in darwin's AR where it is incapable of
   handling files that are not a multiple of 8 bytes long.  BC files
   are only guaranteed to be multiples of 4 bytes long.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53275 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 05:14:23 +00:00
Nick Lewycky
b0b046848f Remove getValueRange from SCEV. It wasn't doing anything there anyways, and a
more complete version is now available from the LoopVR pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53269 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 03:21:51 +00:00
Dan Gohman
f877b735ad const-ify SelectionDAG::getNodeValueTypes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53264 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 00:00:42 +00:00
Dan Gohman
9c6e70eca9 Factor out the code for computing an alignment value, and make it
available to getAtomic in addition to just getLoad and getStore,
to prevent MachineMemOperands with 0 alignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53261 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 23:46:32 +00:00
Dan Gohman
afbd0737e7 The graph name really does matter for configurations that use gv.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53259 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 23:33:46 +00:00
Evan Cheng
ab8faba2fb Unbreak C++ tests on x86 Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53237 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 16:40:43 +00:00
Duncan Sands
cfa3c236b2 Add some helpers for manipulating function
parameter attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 09:41:30 +00:00
Matthijs Kooijman
b3739424da Add CallSite::getArgumentNo() to be able to translate an operand number into a
argument number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53225 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 08:51:47 +00:00
Matthijs Kooijman
8c174a9b5a Add CallSite::getArgumentOffset() to hide the differences in operands betwen
Call and Invoke in a single method instead of having it hardcoded in multiple
places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53224 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 08:50:32 +00:00
Duncan Sands
2e033f31dc Add some convenience methods for manipulating
call attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53223 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 08:38:44 +00:00
Nick Lewycky
6177fd4fce Expand SCEVUDiv of power of 2 to a lshr instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53217 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 05:05:37 +00:00
Evan Cheng
77c8f7674d Avoid unnecessary string construction during asm printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53215 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 00:55:58 +00:00
Dan Gohman
8e5f2c6f65 Pool-allocation for MachineInstrs, MachineBasicBlocks, and
MachineMemOperands. The pools are owned by MachineFunctions.

This drastically reduces the number of calls to malloc/free made
during the "Emit" phase of scheduling, as well as later phases
in CodeGen. Combined with other changes, this speeds up the
"instruction selection" phase of CodeGen by 10% in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53212 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 23:14:23 +00:00
Dan Gohman
0e5f1306b0 Pool-allocation for SDNodes. The pool is allocated once for each function,
and reused across SelectionDAGs.

This drastically reduces the number of calls to malloc/free made during
instruction selection, and improves memory locality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53211 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 23:02:41 +00:00
Dan Gohman
e14d81deeb Add some basic Pool-allocation infrastructure. This adds a Recycler class,
for handling bookkeeping for deleted objects, as well as the alist class
template, for keeping lists of objects allocated from Recyclers, and some
related utilities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53210 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 22:58:06 +00:00
Bill Wendling
667a68b96a Use StringMap for greater justice!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53202 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 20:59:31 +00:00
Dan Gohman
0fe9c6e7ba Fix SDNode::MorphNodeTo (a function used by by SelectNodeTo) to
properly track dead nodes that are on the original SDNode's operand
list but not the new one, and have no other uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53201 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 20:57:48 +00:00
Dan Gohman
ce42e404a2 Move MachineMemOperand's constructor out of line, to avoid a
#include dependency on Support/MathExtras.h in the header file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53200 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 20:32:02 +00:00
Dan Gohman
35c640aee5 Shrink MachineMemOperand by storing the alignment in log form
and rearranging the fields.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53195 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 20:05:04 +00:00
Dan Gohman
9ff0f0ea39 Make ilist noncopyable too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53190 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:43:32 +00:00
Dan Gohman
f178700829 Don't use std::advance just to increment or decrement by one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53189 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:39:33 +00:00
Dan Gohman
7698252750 Make BumpPtrAllocator noncopyable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53188 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:38:14 +00:00
Dan Gohman
dae6f4cf76 Add a space between * and /* to help simple-minded lexers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53187 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:34:27 +00:00
Dan Gohman
6d9cdd5617 Remove most of the uses of SDOperandPtr, usually replacing it with a
simple const SDOperand*, which is what's usually needed.

For AddNodeIDOperands, which is small, just duplicate the function to
accept an SDUse*.

For SelectionDAG::getNode - Add an overload that accepts SDUse* that
copies the operands into a temporary SDOperand array, but also has
special-case checks for 0 through 3 operands to avoid the copy in
the common cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53183 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:26:29 +00:00
Dan Gohman
e4706a0b51 Remove uses of "llvm/Support/Debug.h" from LLVM include files, which
all happened be unnecessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53182 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:14:29 +00:00
Dan Gohman
d24c62c67e Remove unnecessary static_casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53181 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:08:20 +00:00
Dan Gohman
ccd95b5f9c Remove an unnecessary reinterpret_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53180 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:07:36 +00:00
Dan Gohman
1002c02034 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53179 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:00:37 +00:00
Dan Gohman
6b345ee9b2 Make DenseMap's insert return a pair, to more closely resemble std::map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53177 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 17:46:23 +00:00
Ted Kremenek
aa5044d3ce Removed ImmutableMap::SlimFind and replaced it with ImmutableMap::lookup. The new method does the same thing, except that it returns a pointer to the mapped data type, and not to an internal tree node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53171 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 16:20:55 +00:00
Duncan Sands
990f032907 LegalizeTypes soft-float support for stores of a
float value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53165 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 00:08:12 +00:00
Anton Korobeynikov
80585f1daa Add convenient helper for checking whether global is weak in linker sense
having weak or linkonce or common or extweak LLVM linkage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53158 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 23:48:30 +00:00
Nick Lewycky
315b333dea 80col
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53153 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 22:41:37 +00:00
Mon P Wang
364d73ddab Fixed generating incorrect aligned stores that I backout of r53031
that fixed problems in EmitStackConvert where the source and target type
have different alignment by creating a stack slot with the max
alignment of source and target type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53150 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 20:40:31 +00:00
Duncan Sands
126d90770b Rather than having a different custom legalization
hook for each way in which a result type can be
legalized (promotion, expansion, softening etc),
just use one: ReplaceNodeResults, which returns
a node with exactly the same result types as the
node passed to it, but presumably with a bunch of
custom code behind the scenes.  No change if the
new LegalizeTypes infrastructure is not turned on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-04 11:47:58 +00:00
Duncan Sands
ececf99c07 Linux also does not require exception handling
moves in order to get correct debug info.  Since
I can't imagine how any target could possibly
be any different, I've just stripped out the
option: now all the world's like Darwin!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53134 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-04 09:55:48 +00:00
Bill Wendling
c04f46567c Don't return std::vector by value, but pass it in by reference to be filled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53123 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 23:13:02 +00:00
Bill Wendling
10fff6078a Revert my previous check-in that split up MachineModuleInfo. It turns out to
slow the compiler down at -O0 some 30% or more. Ooops.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53120 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 22:53:42 +00:00
Evan Cheng
a122f2f51e Backed out 53031.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53110 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 18:20:14 +00:00
Evan Cheng
9f1c8317a4 - Remove calls to copyKillDeadInfo which is an N^2 function. Instead, propagate kill / dead markers as new instructions are constructed in foldMemoryOperand, convertToThressAddress, etc.
- Also remove LiveVariables::instructionChanged, etc. Replace all calls with cheaper calls which update VarInfo kill list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53097 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 09:09:37 +00:00
Dan Gohman
08c09496c2 Use operator new instead of new char[].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53067 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 00:59:36 +00:00
Evan Cheng
be04dc1413 - Add LiveVariables::replaceKillInstruction. This does a subset of instructionChanged. That is, it only update the VarInfo.kills if the new instruction is known to have the correct dead and kill markers.
- CommuteInstruction copies kill / dead markers over to new instruction. So use replaceKillInstruction instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53061 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 00:07:19 +00:00
Owen Anderson
f660c171c8 Make LiveVariables even more optional, by making it optional in the call to TargetInstrInfo::convertToThreeAddressInstruction
Also, if LV isn't around, then TwoAddr doesn't need to be updating flags, since they won't have been set in the first place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53058 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 23:41:07 +00:00
Dan Gohman
cd920d9ecf Replace a few uses of SelectionDAG::getTargetNode with
SelectionDAG::SelectNodeTo in the instruction selector. This
updates existing nodes in place instead of creating new ones.

Go back to selecting ISD::DBG_LABEL nodes into
TargetInstrInfo::DBG_LABEL nodes instead of leaving them
unselected, now that SelectNodeTo allows us to update them
in place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53057 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 23:23:19 +00:00
Eric Christopher
9bd64ea1d9 Add a couple more helper functions to deal with
creating global constant strings and pointers
to global constant strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53051 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 22:57:59 +00:00
Mon P Wang
6ed2d1ecdb Make the default min align of CreateStackTemporary to be 1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53036 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 17:50:10 +00:00
Duncan Sands
4bdcb61af3 Add a new getMergeValues method that does not need
to be passed the list of value types, and use this
where appropriate.  Inappropriate places are where
the value type list is already known and may be
long, in which case the existing method is more
efficient.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53035 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 17:40:58 +00:00
Owen Anderson
93ee2fd7da Have DenseSet::insert return a bool indicating whether the insertion succeeded or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53033 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 17:29:59 +00:00
Mon P Wang
bee98c66c0 Fixed problem in EmitStackConvert where the source and target type
have different alignment by creating a stack slot with the max
alignment of source and target type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53031 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 17:07:12 +00:00
Chris Lattner
509e4f30e8 optimize StringMap::clear
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53009 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 05:30:45 +00:00
Chris Lattner
fce6e546aa Add a new (simple) StringMap::clear method, patch by Pratik
Solanki!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53008 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 05:26:32 +00:00
Bill Wendling
12432cfc59 Sorry. I couldn't sleep at night knowing I put these ugly casts into the source tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53001 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 00:35:47 +00:00
Ted Kremenek
445723bfb0 Implemented operator!= for the ImmutableList iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52998 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 00:06:55 +00:00
Owen Anderson
72e61b8501 Add a version of AddString that takes a const char* so we can avoid extraneous
conversions to std::string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52995 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 23:49:59 +00:00
Bill Wendling
aa8f8889a8 Darwin doesn't need exception handling information for the "move" info when
debug information is being output, because it's leet!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52994 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 23:34:48 +00:00
Evan Cheng
6547e406cf Avoid creating expensive comment string if it's not going to be printed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52992 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 23:18:29 +00:00
Ted Kremenek
e1bf7fdcb4 Added partial specialization of FoldingSetTrait for pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52989 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 22:30:13 +00:00
Bill Wendling
a28cd12b06 - Update comments.
- Don't use GlobalVariable::LinkageTypes when unsigned works.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52987 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 22:08:01 +00:00
Devang Patel
a45a9e416f Fix dom tree compare. Don't forget to compare children!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52984 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 21:41:00 +00:00
Owen Anderson
25995093e7 Add a version of AsmPrinter::EOL that takes a const char* so that we don't have to do as many implicit std::string constructions.
Unfortunately, this doesn't appear to translate to a real speedup in practice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52981 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 21:16:27 +00:00
Devang Patel
844a3d163b Fix typos in comments.
Thanks for the feedback!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52978 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 19:50:56 +00:00
Evan Cheng
e2c0a4fad5 DAGSize should not be public.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52977 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 18:49:06 +00:00
Dan Gohman
2dad0250f6 Prune a few dependencies on MachineFunction.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52976 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 18:15:35 +00:00
Dan Gohman
8458f5d45b Make ilist_traits<MachineBasicBlock>'s Parent member private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52974 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 18:13:58 +00:00
Dan Gohman
94f9c7dc97 Fix apostrophes in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52972 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 18:12:31 +00:00
Evan Cheng
4576f6d7a9 Do not use computationally expensive scheduling heuristics with -fast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52971 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 18:05:03 +00:00
Devang Patel
5b57e720c8 Add dom info verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 17:44:24 +00:00
Owen Anderson
605041e5a8 Make the subregister hashtable output more readable by wrapping the lines,
and mark it const along with the associated changes to TargetRegisterInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52966 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 17:34:38 +00:00
Owen Anderson
57ce0319b7 Implement suggestions from Chris:
- Use a more accurate heuristic for the size of the hashtable.
  - Use bitwise and instead of modulo since the size is a power of two.
  - Use new[] instead of malloc().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52951 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 07:02:30 +00:00
Seo Sanghyeon
ff4d609ec5 Compilation fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52950 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 05:27:28 +00:00
Owen Anderson
f4f9c4f1cf Replace the dynamically computed std::set lookup method for subregisters with a hashtable-based
version that is computed by tblgen at the time LLVM is compiled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52945 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 00:18:52 +00:00
Dan Gohman
4406604047 Split ISD::LABEL into ISD::DBG_LABEL and ISD::EH_LABEL, eliminating
the need for a flavor operand, and add a new SDNode subclass,
LabelSDNode, for use with them to eliminate the need for a label id
operand.

Change instruction selection to let these label nodes through
unmodified instead of creating copies of them. Teach the MachineInstr
emitter how to emit a MachineInstr directly from an ISD label node.

This avoids the need for allocating SDNodes for the label id and
flavor value, as well as SDNodes for each of the post-isel label,
label id, and label flavor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52943 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 00:05:16 +00:00
Dan Gohman
f4d7708972 Make SmallVector's grow use memcpy in common cases
instead of std::uninitialized_copy, which uses memmove.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52928 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 21:45:13 +00:00
Dan Gohman
7c6618926a Use plain operator new instead of new char[].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52927 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 21:33:02 +00:00
Dan Gohman
87060f55f2 Update comments to new-style syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52925 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 21:00:56 +00:00
Dan Gohman
7f460203b0 Rename ISD::LOCATION to ISD::DBG_STOPPOINT to better reflect its
purpose, and give it a custom SDNode subclass so that it doesn't
need to have line number, column number, filename string, and
directory string, all existing as individual SDNodes to be the
operands.

This was the only user of ISD::STRING, StringSDNode, etc., so
remove those and some associated code.

This makes stop-points considerably easier to read in
-view-legalize-dags output, and reduces overhead (creating new
nodes and copying std::strings into them) on code containing
debugging information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52924 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 20:59:49 +00:00
Evan Cheng
db8d56b825 Split scheduling from instruction selection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52923 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 20:45:06 +00:00
Ted Kremenek
30389141c9 Added some comments and some cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52922 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 20:41:22 +00:00
Dan Gohman
9665c2ae79 Reorder the fields in TargetLowering to require less padding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52919 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 20:36:26 +00:00
Dan Gohman
3d3c3e0cfa Change bools to 1-bit bitfields to shrink ArgListEntry slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52918 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 20:33:57 +00:00
Dan Gohman
a44b674a42 Replace some std::vectors that showed up in heap profiling with
SmallVectors. Change the signature of TargetLowering::LowerArguments
to avoid returning a vector by value, and update the two targets
which still use this directly, Sparc and IA64, accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52917 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 20:31:15 +00:00
Owen Anderson
c602769822 Add an isReachableFromEntry method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52916 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 20:28:02 +00:00
Ted Kremenek
3771902e92 Added ImmutableList, a companion ADT to ImmutableSet and ImmutableMap that is used to represent a purely functional list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52911 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 18:07:38 +00:00
Devang Patel
5b388e40e4 Remove old LTO interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 18:05:29 +00:00
Chris Lattner
f25381ed35 add convenience 'constructors'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52908 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 18:02:44 +00:00
Duncan Sands
f9516208e5 Revert the SelectionDAG optimization that makes
it impossible to create a MERGE_VALUES node with
only one result: sometimes it is useful to be able
to create a node with only one result out of one of
the results of a node with more than one result, for
example because the new node will eventually be used
to replace a one-result node using ReplaceAllUsesWith,
cf X86TargetLowering::ExpandFP_TO_SINT.  On the other
hand, most users of MERGE_VALUES don't need this and
for them the optimization was valuable.  So add a new
utility method getMergeValues for creating MERGE_VALUES
nodes which by default performs the optimization.
Change almost everywhere to use getMergeValues (and
tidy some stuff up at the same time).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52893 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 10:19:09 +00:00
Evan Cheng
2036835346 Eliminate TargetRegisterDesc::ImmSubRegs. It's no longer in use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52892 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 07:32:56 +00:00
Evan Cheng
0ff39b3feb - Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an empty string for ConstantAggregateZero case which surprises selectiondag.
- Correctly handle memcpy from constant string which is zero-initialized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 07:31:25 +00:00
Nick Lewycky
69c8d9be02 Because of the laziness, the required passes must exist even after
LoopVR::runOnFunction runs.

This should accomplish that, but it doesn't. I think that's a PassManager bug,
but without a consumer of LoopVR in the tree, I can't give steps to reproduce.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52886 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 01:04:39 +00:00
Nick Lewycky
a11e2eb845 Add a value range analysis that lazily computes ranges using ScalarEvolutions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 00:04:21 +00:00
Anton Korobeynikov
6d116bc7ce Revert (52748 and friends):
Move GetConstantStringInfo to lib/Analysis. Remove
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.

This unbreaks llvm-gcc bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-29 17:57:03 +00:00
Anton Korobeynikov
28a2b54580 Start refactoring of asmprinters: provide a TAI hook, which will select a 'section kind' for a global.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52868 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 13:45:57 +00:00
Chris Lattner
b746b82113 Add back the capability to include nul characters in strings with
GetConstantStringInfo.  This will hopefully restore llvm-gcc to 
happy bootstrap land.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52851 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 05:33:32 +00:00
Owen Anderson
d98a45d29a Add a NextPowerOf2 function to calculate the next power of two greater than a given integer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52839 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:48:21 +00:00
Chris Lattner
97388469b1 implement some fixme's by making "autorenaming" in the value symbol table not
thrash the heap with string stuff (e.g. utostr).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52838 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:26:26 +00:00
Chris Lattner
d0ebbff8a3 add a helper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52835 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:15:25 +00:00
Chris Lattner
bb0e248718 Add a new version of Module::getFunction that takes a const char* instead
of a std::string.  This avoids copying the string to the heap in common
cases.  Patch by Pratik Solanki!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:09:10 +00:00
Chris Lattner
25b825b3b8 Tweak IRBuilder to explicitly call the setName(const char*) method on Value
instead of passing the name into the instruction ctors.  Since most 
instruction ctors take their name as an std::string, this avoids copying the
string to the heap and a malloc and free.

Patch by Pratik Solanki!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52832 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 18:49:21 +00:00
Cedric Venet
5e950627f9 Add an include file needed for VS.
Add two new file to codegen project (VS).
This unbreak the build for VS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52831 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 18:00:09 +00:00
Owen Anderson
1360b7d8f8 Cache subregister relationships in a set in TargetRegisterInfo to allow faster lookups.
This speeds up LiveVariables from 0.6279s to 0.6165s on kimwitu++.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52818 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 06:56:04 +00:00
Chris Lattner
3648f9f0ae fix the regressions from Eric's patch by making GetConstantStringInfo
tolerate a non-nul-terminated string, and handling a direct global 
reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52813 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 03:36:51 +00:00
Bill Wendling
83b28890d8 More cruft from revert...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52809 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 01:37:37 +00:00
Bill Wendling
914c970899 Reverting broken patch r52803.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52806 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 01:27:56 +00:00
Bill Wendling
e6b6bae536 - Remove a use of std::vector.
- Make sure that we're not recalculating the size of a vector
  that never changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52803 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 00:56:36 +00:00
Bill Wendling
305635abea Refactor the DebugInfoDesc stuff out of the MachineModuleInfo file. Clean up
some uses of std::vector, where it's return std::vector by value. Yuck!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52800 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 00:09:40 +00:00
Chris Lattner
af0a7e88d7 allow updating the MPM, so that you can use one FunctionPAssManager with
multiple ModuleProviders, e.g. with the JIT.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52796 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 22:26:45 +00:00
Bill Wendling
8032020cf2 Remove warnings about shadowed and unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52791 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 18:11:45 +00:00
Owen Anderson
8001524f43 Use a DenseMap instead of an std::map for mangled name lookup. This is
improves AsmPrinter runtime on instcombine from 0.3920s to 0.3836s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52787 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 17:20:16 +00:00
Matthijs Kooijman
65c9216a39 Add missing semicolumn in my last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52780 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 09:49:38 +00:00
Matthijs Kooijman
b0ed11f4a0 Improve comments wrt createInternalize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52779 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 09:48:11 +00:00
Dale Johannesen
b5dae00325 Fixes the last x86-64 test failure in compat.exp:
<16 x float> is 64-byte aligned (for some reason),
which gets us into the stack realignment code.  The
computation changing FP-relative offsets to SP-relative
was broken, assiging a spill temp to a location
also used for parameter passing.  This
fixes it by rounding up the stack frame to a multiple
of the largest alignment (I concluded it wasn't fixable
without doing this, but I'm not very sure.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52750 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 01:51:13 +00:00
Eric Christopher
0d2b0aba42 Move GetConstantStringInfo to lib/Analysis. Remove
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 00:31:12 +00:00
Owen Anderson
6b098dee28 Remember which MachineOperand we were processing, so we don't have to scan the list to find it again later.
This speeds up live intervals from 0.37s to 0.30s on instcombine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52745 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-25 23:39:39 +00:00
Duncan Sands
041cde26ea Add support for expanding PPC 128 bit floats.
For this it is convenient to permit floats to
be used with EXTRACT_ELEMENT, so I tweaked
things to allow that.  I also added libcalls
for ppcf128 to i32 forms of FP_TO_XINT, since
they exist in libgcc and this case can certainly
occur (and does occur in the testsuite) - before
the i64 libcall was being used.  Also, the
XINT_TO_FP result seemed to be wrong when
the argument is an i128: the wrong fudge
factor was added (the i32 and i64 cases were
handled directly, but the i128 code fell
through to some generic softening code which
seemed to think it was i64 to f32!).  So I
fixed it by adding a fudge factor that I
found in my breakfast cereal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52739 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-25 20:24:48 +00:00
Chris Lattner
bc52cada09 Switch the PPC backend and target-independent JIT to use the libsystem
InvalidateInstructionCache method instead of calling through
a hook on the JIT.  This is a host feature, not a target feature.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52734 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-25 17:18:44 +00:00
Chris Lattner
93bb4aa0ce Add a new InvalidateInstructionCache method to sys::Memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52731 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-25 17:14:10 +00:00
Dan Gohman
fd4418fc9b Remove the OrigVT member from AtomicSDNode, as it is redundant with
the base SDNode's VTList.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52722 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-25 16:07:49 +00:00
Mon P Wang
2887310630 Added MemOperands to Atomic operations since Atomics touches memory.
Added abstract class MemSDNode for any Node that have an associated MemOperand
Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and
atomic.lss => atomic.load.sub


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52706 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-25 08:15:39 +00:00
Dan Gohman
f4dc289cea Make Allocate<T>() return a T* instead of a void*. And use
static_cast instead of reinterpret_cast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52686 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 17:49:26 +00:00
Dan Gohman
4f37660fa1 Correct a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52683 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 17:46:48 +00:00
Chris Lattner
58a4c5e8e3 Add support for building on solaris, working around namespace
polution problems from system headers.  Patch by Nathan Keynes!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52682 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 17:44:42 +00:00
Dan Gohman
2b08676ca8 Pass std::string by reference. Thanks Chris!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52678 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 16:40:22 +00:00
Matthijs Kooijman
4e78908b94 Rename a few variables to be more consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52672 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 09:14:10 +00:00
Owen Anderson
f399235a03 Remove an incorrect comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52660 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 00:15:10 +00:00
Owen Anderson
a6fb5b54f3 Use InstrSlots::NUM rather than pre-dividing by four. Also, mark this const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 00:08:35 +00:00
Dan Gohman
a0b50d7f0d Comment fixes, and make Schedule() pure virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52658 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 00:02:44 +00:00
Dan Gohman
caf746aa5a Add a clear() method to PriorityQueue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52656 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 23:47:46 +00:00
Owen Anderson
72e04099c6 Add getScaledIntervalSize, which gives a measure of the size of an interval that is independent of the scaling of
the function due to empty index slots.  This is suitable for use in backend heuristics that need to reason about the density
of an interval.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52652 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 23:25:37 +00:00
Dan Gohman
2904538fc3 Simplify erase_one slightly. It's not necessary to preserve
the value of the element to be erased while the heap is
being updated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52646 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 21:46:21 +00:00
Dan Gohman
4b84086e89 Use StringMap instead of std::map<std::string, SDNode*>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52641 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 21:08:32 +00:00
Dan Gohman
84701836bf Add methods to StringMap to erase entries by key.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52640 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 21:07:03 +00:00
Evan Cheng
99ec779a93 Instead of adding an isSS field to LiveInterval to denote stack slot. Use top bit of 'reg' instead. If the top bit is set, than the LiveInterval represents a stack slot live interval.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52639 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 21:03:19 +00:00
Wojciech Matyjewicz
300c6c5167 First step to fix PR2088. Implement routine to compute the
multiplicative inverse of a given number. Modify udivrem to allow input and 
output pairs of arguments to overlap. Patch is based on the work by Chandler
Carruth.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52638 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 19:39:50 +00:00
Dan Gohman
2f27e174a9 Remove two convenience constructors because they're now private, and the
private implementation doesn't really need the convenience.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52629 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 16:48:17 +00:00
Dan Gohman
19a81633b0 Remove an unnecessary cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52626 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 16:38:10 +00:00
Dan Gohman
17f1972c77 Use SCEVAddRecExpr::isAffine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52614 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-22 19:23:09 +00:00
Dan Gohman
11f6d3b478 Move a few more SCEVExpander methods out-of-line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52612 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-22 19:09:18 +00:00
Dan Gohman
cdb7388233 Reorder some fields in SDNode. This avoids padding,
reducings its size from 80 to 72 on 64-bit hosts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52584 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 19:26:15 +00:00
Dan Gohman
94d7a5f815 Remove ScheduleDAG's SUnitMap altogether. Instead, use SDNode's NodeId
field, which is otherwise unused after instruction selection, as an index
into the SUnit array.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52583 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 19:18:17 +00:00
Dan Gohman
3627e34486 Add a priority queue class, which is a wrapper around std::priority_queue
and provides fairly efficient removal of arbitrary elements. Switch
ScheduleDAGRRList from std::set to this new priority queue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52582 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 18:35:25 +00:00
Dan Gohman
4c8c83022b Change ScheduleDAG's SUnitMap from DenseMap<SDNode*, vector<SUnit*> >
to DenseMap<SDNode*, SUnit*>, and adjust the way cloned SUnit nodes are
handled so that only the original node needs to be in the map.
This speeds up llc on 447.dealII.llvm.bc by about 2%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52576 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 15:52:51 +00:00
Evan Cheng
c3417609ae Undo spill weight tweak. Need to investigate the performance regressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52572 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 06:45:54 +00:00
Duncan Sands
c8f88cc8c0 Add some methods for querying the nature of a
store, like the methods for loads (and neaten
those up a bit while there).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52547 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 18:34:30 +00:00
Dan Gohman
be20a88f53 Add an allnodes_size method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52541 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 16:03:16 +00:00
Dan Gohman
65c6795af4 It's invalid to take the one-past-the-end address of a non-array
object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 00:49:21 +00:00
Owen Anderson
5678d6e8d3 Add an idx_iterator to the insertvalue and extractvalue instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52493 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 17:15:57 +00:00
Dan Gohman
e6807551cb The inline keyword goes before the return type. This fixes a compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52492 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 16:16:06 +00:00
Evan Cheng
bdf34bc12b Minor spiller tweak to unfavor reload into load/store instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52477 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 01:16:17 +00:00
Dan Gohman
e24fa64d52 Move SCEVExpander::visitAddExpr out-of-line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-18 16:37:11 +00:00
Dan Gohman
cfeb6a4506 Move LSR's private isZero function to a public SCEV member
function, and make use of it in several places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52463 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-18 16:23:07 +00:00
Evan Cheng
ce049437d6 Add MachineRegisterInfo::use_empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52451 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-18 07:47:55 +00:00
Devang Patel
6d0cc55ef3 Check empty dominance frontier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52437 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-18 02:12:09 +00:00
Dan Gohman
44f6a2c951 Auto-upgrade code for multiple-value return statements. This code
isn't actually called yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52435 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 23:38:43 +00:00