summaryrefslogtreecommitdiff
path: root/lib/CodeGen/Spiller.cpp
Commit message (Collapse)AuthorAge
* Remove unused STL header includes.Jay Foad2011-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130068 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the Spiller interface to take a LiveRangeEdit reference.Jakob Stoklund Olesen2011-03-10
| | | | | | | This makes it possible to register delegates and get callbacks when the spiller edits live ranges. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127389 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SpillIs an optional pointer. Avoid creating a bunch of temporary ↵Jakob Stoklund Olesen2011-03-10
| | | | | | SmallVectors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127388 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach TargetRegisterInfo how to cram stack slot indexes in with the virtual andJakob Stoklund Olesen2011-01-09
| | | | | | | | | | | | | physical register numbers. This makes the hack used in LiveInterval official, and lets LiveInterval be oblivious of stack slots. The isPhysicalRegister() and isVirtualRegister() predicates don't know about this, so when a variable may contain a stack slot, isStackSlot() should always be tested first. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123128 91177308-0d34-0410-b5e6-96231b3b80d8
* Force the greedy register allocator to always use the inline spiller.Jakob Stoklund Olesen2010-12-10
| | | | | | | Soon, RegAllocGreedy will start splitting live ranges, and then deferred spilling won't work anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121591 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete SplittingSpiller. It was not being used by anyone, and it is beingJakob Stoklund Olesen2010-11-11
| | | | | | superceded by SplitKit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118754 91177308-0d34-0410-b5e6-96231b3b80d8
* RABasic is nearly functionally complete. There are a few remainingAndrew Trick2010-11-10
| | | | | | | | | | benchmarks hitting an assertion. Adds LiveIntervalUnion::collectInterferingVRegs. Fixes "late spilling" by checking for any unspillable live vregs among all physReg aliases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118701 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the spiller responsible for updating the LiveStacks analysis.Jakob Stoklund Olesen2010-10-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117337 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing ↵Lang Hames2010-09-25
| | | | | | whether LiveIntervals::getInstructionFromIndex(def) returns NULL. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114791 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the only use of SlotIndex::isPHI. This bit is not being set consistentlyJakob Stoklund Olesen2010-09-25
| | | | | | and it will be removed shortly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114778 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the Spiller.h interface.Jakob Stoklund Olesen2010-08-13
| | | | | | | | | The earliestStart argument is entirely specific to linear scan allocation, and can be easily calculated by RegAllocLinearScan. Replace std::vector with SmallVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111055 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the createSpiller interface to take a MachineFunctionPass argument.Jakob Stoklund Olesen2010-07-20
| | | | | | | | The spillers can pluck the analyses they need from the pass reference. Switch some never-null pointers to references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108969 91177308-0d34-0410-b5e6-96231b3b80d8
* Spillers may alter MachineLoopInfo when breaking critical edges, so make itJakob Stoklund Olesen2010-07-19
| | | | | | non-const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108734 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace copyRegToReg with COPY everywhere in lib/CodeGen except for FastISel.Jakob Stoklund Olesen2010-07-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108062 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix to 80-col.Eric Christopher2010-07-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107684 91177308-0d34-0410-b5e6-96231b3b80d8
* Some fool committed without testing (or even building) first.Jakob Stoklund Olesen2010-06-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107307 91177308-0d34-0410-b5e6-96231b3b80d8
* Remember to track spill slot uses in VirtRegMap when inserting loads and stores.Jakob Stoklund Olesen2010-06-30
| | | | | | | | | LocalRewriter::runOnMachineFunction uses this information to mark dead spill slots. This means that InlineSpiller now also works for functions that spill. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107302 91177308-0d34-0410-b5e6-96231b3b80d8
* Use clEnumValN macro to work around keyword clashJakob Stoklund Olesen2010-06-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107233 91177308-0d34-0410-b5e6-96231b3b80d8
* Begin implementation of an inline spiller.Jakob Stoklund Olesen2010-06-29
| | | | | | | | | | | InlineSpiller inserts loads and spills immediately instead of deferring to VirtRegMap. This is possible now because SlotIndexes allows instructions to be inserted and renumbered. This is work in progress, and is mostly a copy of TrivialSpiller so far. It works very well for functions that don't require spilling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107227 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't track kills in VNInfo. Use interval ends instead.Jakob Stoklund Olesen2010-06-25
| | | | | | | | | | | | The VNInfo.kills vector was almost unused except for all the code keeping it updated. The few places using it were easily rewritten to check for interval ends instead. The two new methods LiveInterval::killedAt and killedInRange are replacements. This brings us down to 3 independent data structures tracking kills. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106905 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't return a std::vector in the Spiller interface, but take a reference to aJakob Stoklund Olesen2010-06-24
| | | | | | | | vector instead. This avoids needless copying and allocation. Add documentation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106788 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes for Microsoft Visual Studio 2010, from Steven Watanabe!Douglas Gregor2010-05-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103457 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a DebugLoc argument to TargetInstrInfo::copyRegToReg, so that itDan Gohman2010-05-06
| | | | | | | doesn't have to guess. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103194 91177308-0d34-0410-b5e6-96231b3b80d8
* Add argument TargetRegisterInfo to loadRegFromStackSlot and storeRegToStackSlot.Evan Cheng2010-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103193 91177308-0d34-0410-b5e6-96231b3b80d8
* 80 col violation.Evan Cheng2010-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103185 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some unneeded errorhandling stuff.Chris Lattner2010-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100703 91177308-0d34-0410-b5e6-96231b3b80d8
* Change errs() to dbgs().David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92591 91177308-0d34-0410-b5e6-96231b3b80d8
* Changed slot index ranges for MachineBasicBlocks to be exclusive of endpoint.Lang Hames2009-12-22
| | | | | | | This fixes an in-place update bug where code inserted at the end of basic blocks may not be covered by existing intervals which were live across the entire block. It is also consistent with the way ranges are specified for live intervals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91859 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a new "splitting" spiller.Lang Hames2009-12-09
| | | | | | | | | | | | | | | | When a call is placed to spill an interval this spiller will first try to break the interval up into its component values. Single value intervals and intervals which have already been split (or are the result of previous splits) are spilled by the default spiller. Splitting intervals as described above may improve the performance of generated code in some circumstances. This work is experimental however, and it still miscompiles many benchmarks. It's not recommended for general use yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90951 91177308-0d34-0410-b5e6-96231b3b80d8
* improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner2009-12-03
| | | | | | | Patch by Howard Hinnant! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90365 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed references to LiveStacks from Spiller.* . They're no longer needed.Lang Hames2009-11-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89422 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a new Spiller implementation which wraps ↵Lang Hames2009-11-19
| | | | | | | | | | | LiveIntervals::addIntervalsForSpills. All spiller calls in RegAllocLinearScan now go through the new Spiller interface. The "-new-spill-framework" command line option has been removed. To use the trivial in-place spiller you should now pass "-spiller=trivial -rewriter=trivial". (Note the trivial spiller/rewriter are only meant to serve as examples of the new in-place modification work. Enabling them will yield terrible, though hopefully functional, code). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89311 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed the in-place spiller and trivial rewriter, which had been broken by ↵Lang Hames2009-11-18
| | | | | | the recent SlotIndexes work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89238 91177308-0d34-0410-b5e6-96231b3b80d8
* Added an API to the SlotIndexes pass to allow new instructions to be ↵Lang Hames2009-11-14
| | | | | | | | | | inserted into the numbering. PreAllocSplitting is now using this API to insert code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88725 91177308-0d34-0410-b5e6-96231b3b80d8
* The Indexes Patch.Lang Hames2009-11-03
| | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85979 91177308-0d34-0410-b5e6-96231b3b80d8
* Oops. Renamed remaining MachineInstrIndex references.Lang Hames2009-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83255 91177308-0d34-0410-b5e6-96231b3b80d8
* Renamed MachineInstrIndex to LiveIndex.Lang Hames2009-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83254 91177308-0d34-0410-b5e6-96231b3b80d8
* Replaces uses of unsigned for indexes in LiveInterval and VNInfo withLang Hames2009-09-04
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81040 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert DOUT to DEBUG(errs()...).Bill Wendling2009-08-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79766 91177308-0d34-0410-b5e6-96231b3b80d8
* Improved tracking of value number kills. VN kills are now representedLang Hames2009-07-09
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75097 91177308-0d34-0410-b5e6-96231b3b80d8
* Completed basic intra block split implementation.Lang Hames2009-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74114 91177308-0d34-0410-b5e6-96231b3b80d8
* More VNInfo tweaking, plus a little progress on intra-block splitting.Lang Hames2009-06-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73750 91177308-0d34-0410-b5e6-96231b3b80d8
* VNInfo cleanup.Lang Hames2009-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73634 91177308-0d34-0410-b5e6-96231b3b80d8
* Update to in-place spilling framework. Includes live interval scaling and ↵Lang Hames2009-06-02
| | | | | | trivial rewriter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72729 91177308-0d34-0410-b5e6-96231b3b80d8
* New Spiller interface and trivial implementation.Lang Hames2009-05-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72030 91177308-0d34-0410-b5e6-96231b3b80d8
* Renamed Spiller classes (plus uses and related files) to VirtRegRewriter.Lang Hames2009-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71057 91177308-0d34-0410-b5e6-96231b3b80d8
* It has finally happened. Spiller is now using live interval info.Evan Cheng2009-04-21
| | | | | | | This fixes a very subtle bug. vr defined by an implicit_def is allowed overlap with any register since it doesn't actually modify anything. However, if it's used as a two-address use, its live range can be extended and it can be spilled. The spiller must take care not to emit a reload for the vn number that's defined by the implicit_def. This is both a correctness and performance issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69743 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach spiller to unfold instructions which modref spill slot when a scratchEvan Cheng2009-04-17
| | | | | | | | | | | | | | | | | | | | | register is available and when it's profitable. e.g. xorq %r12<kill>, %r13 addq %rax, -184(%rbp) addq %r13, -184(%rbp) ==> xorq %r12<kill>, %r13 movq -184(%rbp), %r12 addq %rax, %r12 addq %r13, %r12 movq %r12, -184(%rbp) Two more instructions, but fewer memory accesses. It can also open up opportunities for more optimizations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69341 91177308-0d34-0410-b5e6-96231b3b80d8
* When assigning a physical register to a MachineOperand, setDan Gohman2009-04-13
| | | | | | | | | | the subreg field to 0, since the subreg field is only used for virtual register subregs. This doesn't change current functionality; it just eliminates bogus noise from debug output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68955 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix pr3954. The register scavenger asserts for inline assembly withBob Wilson2009-04-09
| | | | | | | | | | | | | register destinations that are tied to source operands. The TargetInstrDescr::findTiedToSrcOperand method silently fails for inline assembly. The existing MachineInstr::isRegReDefinedByTwoAddr was very close to doing what is needed, so this revision makes a few changes to that method and also renames it to isRegTiedToUseOperand (for consistency with the very similar isRegTiedToDefOperand and because it handles both two-address instructions and inline assembly with tied registers). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68714 91177308-0d34-0410-b5e6-96231b3b80d8