Commit Graph

108 Commits

Author SHA1 Message Date
Dan Gohman 4a618827de Fix "the the" and similar typos.
llvm-svn: 95781
2010-02-10 16:03:48 +00:00
Chris Lattner b06015aa69 move target-independent opcodes out of TargetInstrInfo
into TargetOpcodes.h.  #include the new TargetOpcodes.h
into MachineInstr.  Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the 
codebase.

llvm-svn: 95687
2010-02-09 19:54:29 +00:00
David Greene d18966c79f Change errs() to dbgs().
llvm-svn: 92596
2010-01-05 01:26:09 +00:00
Bill Wendling 3c13667d14 Revert accidental commit.
llvm-svn: 91635
2009-12-17 23:45:18 +00:00
Bill Wendling 819c356a09 Turn off critical edge splitting for landing pads. The introduction of a
non-landing pad basic block as the successor to a block that ends in an
unconditional jump will cause block folding to remove the added block as a
successor. Thus eventually removing it AND the landing pad entirely. Critical
edge splitting is an optimization, so we can safely turn it off when dealing
with landing pads.

llvm-svn: 91634
2009-12-17 23:42:32 +00:00
Lang Hames 05fb9637f6 The Indexes Patch.
This introduces a new pass, SlotIndexes, which is responsible for numbering
instructions for register allocation (and other clients). SlotIndexes numbering
is designed to match the existing scheme, so this patch should not cause any
changes in the generated code.

For consistency, and to avoid naming confusion, LiveIndex has been renamed
SlotIndex.

The processImplicitDefs method of the LiveIntervals analysis has been moved
into its own pass so that it can be run prior to SlotIndexes. This was
necessary to match the existing numbering scheme.

llvm-svn: 85979
2009-11-03 23:52:08 +00:00
Nick Lewycky 974e12b2d3 Remove includes of Support/Compiler.h that are no longer needed after the
VISIBILITY_HIDDEN removal.

llvm-svn: 85043
2009-10-25 06:57:41 +00:00
Nick Lewycky 02d5f77d26 Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.

llvm-svn: 85042
2009-10-25 06:33:48 +00:00
Lang Hames a7780905e7 Oops. Renamed remaining MachineInstrIndex references.
llvm-svn: 83255
2009-10-03 04:31:31 +00:00
Lang Hames 920301ecc5 Renamed MachineInstrIndex to LiveIndex.
llvm-svn: 83254
2009-10-03 04:21:37 +00:00
Lang Hames 6b81770040 Removed static qualifier from a few index related methods. These methods may require a LiveIntervals instance in future.
llvm-svn: 81374
2009-09-09 20:14:17 +00:00
Lang Hames 3fffe62177 Replaces uses of unsigned for indexes in LiveInterval and VNInfo with
a new class, MachineInstrIndex, which hides arithmetic details from
most clients. This is a step towards allowing the register allocator
to update/insert code during allocation.

llvm-svn: 81040
2009-09-04 20:41:11 +00:00
Chris Lattner 4dc3edde9f remove a few DOUTs here and there.
llvm-svn: 79832
2009-08-23 06:35:02 +00:00
Lang Hames 3b90d973b0 Modified VNInfo. The "copy" member is now a union which holds the copy for a register interval, or the defining register for a stack interval. Access is via getCopy/setCopy and getReg/setReg.
llvm-svn: 78620
2009-08-10 23:43:28 +00:00
Dan Gohman 0402315d41 Use setPreservesAll and setPreservesCFG in CodeGen passes.
llvm-svn: 77754
2009-07-31 23:37:33 +00:00
Lang Hames dab7b06de9 Improved tracking of value number kills. VN kills are now represented
as an (index,bool) pair. The bool flag records whether the kill is a
PHI kill or not. This code will be used to enable splitting of live
intervals containing PHI-kills.

A slight change to live interval weights introduced an extra spill
into lsr-code-insertion (outside the critical sections). The test 
condition has been updated to reflect this.

llvm-svn: 75097
2009-07-09 03:57:02 +00:00
Lang Hames 16cab1935e VNInfo cleanup.
llvm-svn: 73634
2009-06-17 21:01:20 +00:00
Lang Hames fc968ef687 Update to in-place spilling framework. Includes live interval scaling and trivial rewriter.
llvm-svn: 72729
2009-06-02 16:53:25 +00:00
Owen Anderson fe1f3d6e08 Fix a bug in live-in detection that caused lost-copy problems to show up.
llvm-svn: 57424
2008-10-12 20:39:30 +00:00
Argyrios Kyrtzidis 68fec886ed Fix compilation error on MSVC.
llvm-svn: 57046
2008-10-04 08:11:49 +00:00
Dan Gohman 0d1e9a8e04 Switch the MachineOperand accessors back to the short names like
isReg, etc., from isRegister, etc.

llvm-svn: 57006
2008-10-03 15:45:36 +00:00
Owen Anderson c5b45fec6b Use a multimap rather than a map for holding the list of copies to insert, so we don't lose copies when two of them have
the same source.  I don't know what I was thinking when I wrote this originally.
Note: There's probably a more efficient way to do this, but I need to think about it some more, and about what determinism
guarantees need to be present.

llvm-svn: 56964
2008-10-02 19:40:33 +00:00
Owen Anderson 15e6be8cc5 Mark merged-in VNInfo's as being PHIKilled.
llvm-svn: 56893
2008-09-30 23:58:47 +00:00
Owen Anderson a381313d98 We don't need to insert copies for implicit_def's.
llvm-svn: 56674
2008-09-26 18:50:46 +00:00
Owen Anderson 4ef4b1a7c1 Fix off-by-one error when updating live intervals.
llvm-svn: 56567
2008-09-24 21:30:38 +00:00
Owen Anderson 4cdc18ad80 Add initial support for inserting last minute copies.
llvm-svn: 56485
2008-09-23 04:37:10 +00:00
Owen Anderson 97364655dc Significant improvements to the logic for merging live intervals. This code can't
just use LI::MergeValueAsValue, as its behavior in the presence of overlapping ranges
isn't what StrongPHIElimination wants.

llvm-svn: 56472
2008-09-22 21:58:58 +00:00
Dan Gohman a79db30d28 Tidy up several unbeseeming casts from pointer to intptr_t.
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Dan Gohman 8de6d22392 Use empty() instead of begin() == end().
llvm-svn: 54780
2008-08-14 18:13:49 +00:00
Owen Anderson ef96ac4f95 Get rid of unused variable.
llvm-svn: 54742
2008-08-13 17:44:52 +00:00
Owen Anderson 65fce4d813 1) Merge entire live intervals instead of parts of them.
2) Conditionalize temporary insertion if we don't need it.

llvm-svn: 54741
2008-08-13 17:25:42 +00:00
Owen Anderson d172c15ab0 Do a dominator walk when scheduling copies, rather than a DFS on the CFG. Also, fix a few problems when creating
live intervals for temporaries created by phi elimination.

llvm-svn: 54483
2008-08-07 18:28:07 +00:00
Owen Anderson 8a8d6f0a78 Correct handle cases where two phis are coalesced together, and correct break up the case where two different
phis want to coalesce with the same vreg.

llvm-svn: 54426
2008-08-06 22:08:58 +00:00
Owen Anderson 987b5057d3 We don't need to try to coalesce input vregs that are the same as the output vreg.
llvm-svn: 54422
2008-08-06 20:29:20 +00:00
Owen Anderson f9fca2f2dc Only trim a live interval if the register is not used after the PHI node.
llvm-svn: 54421
2008-08-06 18:36:17 +00:00
Owen Anderson d9b88a85f2 Oops, we were already checking for dead phis. Handle this the proper way, then.
llvm-svn: 54371
2008-08-05 21:18:51 +00:00
Owen Anderson d4ffa4eb57 We don't need to update live intervals for dead PHIs.
llvm-svn: 54369
2008-08-05 20:51:26 +00:00
Owen Anderson c818c01539 Use existing LiveInterval methods to simplify live interval merging. Thanks to Evan for pointing these out.
llvm-svn: 54225
2008-07-30 18:27:35 +00:00
Owen Anderson 1aebe49ae7 When merging live intervals, we also need to merge in any live ranges that are inputs to two-address instructions
that themselves define a range we already care about.

llvm-svn: 54185
2008-07-30 00:21:16 +00:00
Owen Anderson 6b1cc46fee When merging a PHI operand's live interval into the PHI's live interval, we need to merge over all liveranges in
the operand's interval that share the relevant value number, not just the range that immediately precedes the PHI.

llvm-svn: 54174
2008-07-29 21:17:08 +00:00
Owen Anderson 54912b3e8d Fix the issues originally addressed in r54070. After thinking about it some more, I realized that the right thing to do
is to have StrongPHIElimination use its knowledge of the PHIs before they're erased to update the intervals appropriate.  This is
both simpler and more accurate than the alternative, which was having LIA figure it out when it renumbered things, plus it's just
the right thing to do!

llvm-svn: 54077
2008-07-25 23:38:08 +00:00
Owen Anderson 0346aba5c2 In order to avoid reprocessing a register more than once, we need to add it
to the handled set so it will get filtered out in future iterations.

llvm-svn: 54065
2008-07-25 21:35:43 +00:00
Owen Anderson d9c8711d70 Remove live interval entries for an interval if we're eliminating its only VN.
llvm-svn: 54062
2008-07-25 21:08:41 +00:00
Owen Anderson 79b66966b8 Store the predecessor MBB in the PHIUnion, rather than an index, since the indices will change after renumbering.
llvm-svn: 53985
2008-07-24 17:12:16 +00:00
Owen Anderson 05d1cd99b3 Remove debugging code.
llvm-svn: 52016
2008-06-05 18:43:34 +00:00
Owen Anderson 65dc2b2e06 Use the newly created helper on LiveIntervals.
llvm-svn: 52013
2008-06-05 17:22:53 +00:00
Owen Anderson 3a697779fe Correctly construct live intervals for the copies we inserted into the predecessors of a block containing a PHI.
llvm-svn: 51950
2008-06-04 17:55:58 +00:00
Owen Anderson c777d9e6fe We need to subtract one from this index because live ranges are open at the end.
llvm-svn: 51922
2008-06-04 00:38:56 +00:00
Owen Anderson e785fb639c Preserve the register coallescer, and update live intervals more correctly by triggering a renumbering after phi elimination.
llvm-svn: 51780
2008-05-30 18:38:26 +00:00
Dan Gohman 0479aa5c0b Change class' public PassInfo variables to by initialized with the
address of the PassInfo directly instead of calling getPassInfo.
This eliminates a bunch of dynamic initializations of static data.

Also, fold RegisterPassBase into PassInfo, make a bunch of its
data members const, and rearrange some code to initialize data
members in constructors instead of using setter member functions.

llvm-svn: 51022
2008-05-13 02:05:11 +00:00