summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveInterval.cpp
Commit message (Collapse)AuthorAge
...
* 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
* Replace TargetRegisterInfo::printReg with a PrintReg class that also works ↵Jakob Stoklund Olesen2011-01-09
| | | | | | | | | | without a TRI instance. Print virtual registers numbered from 0 instead of the arbitrary FirstVirtualRegister. The first virtual register is printed as %vreg0. TRI::NoRegister is printed as %noreg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123107 91177308-0d34-0410-b5e6-96231b3b80d8
* Use IntEqClasses to compute connected components of live intervals.Jakob Stoklund Olesen2010-12-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122296 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR8815 by checking for an explicit clobber def tied to a use operand inCameron Zwarich2010-12-19
| | | | | | | ConnectedVNInfoEqClasses::Classify(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122202 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ConnectedVNInfoEqClasses::Classify to deal with unused values.Jakob Stoklund Olesen2010-10-29
| | | | | | | | We don't want unused values forming their own equivalence classes, so we lump them all together in one class, and then merge them with the class of the last used value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117670 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix broken equivalence class calculation. We could probably also useJakob Stoklund Olesen2010-10-29
| | | | | | | EquvivalenceClasses.h except it looks like overkill when elements are continuous integers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117631 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence compiler warning.Benjamin Kramer2010-10-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116156 91177308-0d34-0410-b5e6-96231b3b80d8
* Classify value numbers into connected components in linear time.Jakob Stoklund Olesen2010-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116105 91177308-0d34-0410-b5e6-96231b3b80d8
* After splitting, the remaining LiveInterval may be fragmented into multipleJakob Stoklund Olesen2010-10-07
| | | | | | | | | | | | | connected components. These components should be allocated different virtual registers because there is no reason for them to be allocated together. Add the ConnectedVNInfoEqClasses class to calculate the connected components, and move values to new LiveIntervals. Use it from SplitKit::rewrite by creating new virtual registers for the components. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116006 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak VNInfo printing.Jakob Stoklund Olesen2010-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115650 91177308-0d34-0410-b5e6-96231b3b80d8
* Add assert for valid slot indexes.Jakob Stoklund Olesen2010-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115649 91177308-0d34-0410-b5e6-96231b3b80d8
* When RemoveCopyByCommutingDef is creating additional identity copies, just useJakob Stoklund Olesen2010-10-01
| | | | | | | | | | | LiveInterval::MergeValueNumberInto instead of trying to extend LiveRanges and getting it wrong. This fixed PR8249 where a valno with a multi-segment live range was defined by an identity copy created by RemoveCopyByCommutingDef. Some of the live segments disappeared. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115385 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
* Refix MSVC9 and upper_bound. It actually needs a fully symmetric comparator.Jakob Stoklund Olesen2010-09-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114469 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't pollute the global namespace.Jakob Stoklund Olesen2010-09-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114459 91177308-0d34-0410-b5e6-96231b3b80d8
* MSVC9 does not support upper_bound with an asymmetric comparator.Jakob Stoklund Olesen2010-09-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114455 91177308-0d34-0410-b5e6-96231b3b80d8
* Add LiveInterval::find and use it for most LiveRange searching operationsJakob Stoklund Olesen2010-09-21
| | | | | | | | | | | | instead of calling lower_bound or upper_bound directly. This cleans up the search logic a bit because {lower,upper}_bound compare LR->start by default, and it is usually simpler to search LR->end. Funnelling all searches through one function also makes it possible to replace the search algorithm with something faster than binary search. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114448 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead method.Jakob Stoklund Olesen2010-09-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114447 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code.Jakob Stoklund Olesen2010-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113386 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code.Jakob Stoklund Olesen2010-09-04
| | | | | | | Clobber ranges are no longer used when joining physical registers. Instead, all aliases are checked for interference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113084 91177308-0d34-0410-b5e6-96231b3b80d8
* Also recompute HasPHIKill flags in LiveInterval::RenumberValues.Jakob Stoklund Olesen2010-08-12
| | | | | | | If a phi-def value were removed from the interval, the phi-kill flags are no longer valid. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110949 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespace.Jakob Stoklund Olesen2010-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110944 91177308-0d34-0410-b5e6-96231b3b80d8
* Transpose the calculation of spill weights such that we are calculating oneJakob Stoklund Olesen2010-08-10
| | | | | | | | | | | | | | register at a time. This turns out to be slightly faster than iterating over instructions, but more importantly, it allows us to compute spill weights for new registers created after the spill weight pass has run. Also compute the allocation hint at the same time as the spill weight. This allows us to use the spill weight as a cost metric for copies, and choose the most profitable hint if there is more than one possibility. The new hints provide a very small (< 0.1%) but universal code size improvement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110631 91177308-0d34-0410-b5e6-96231b3b80d8
* Add LiveInterval::RenumberValues - Garbage collection for VNInfos.Jakob Stoklund Olesen2010-08-06
| | | | | | | After heavy editing of a live interval, it is much easier to simply renumber the live values instead of trying to keep track of the unused ones. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110463 91177308-0d34-0410-b5e6-96231b3b80d8
* Prefix `next' iterator operation with `llvm::'.Oscar Fuentes2010-08-02
| | | | | | | | | Fixes potential ambiguity problems on VS 2010. Patch by nobled! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110029 91177308-0d34-0410-b5e6-96231b3b80d8
* Factored out a bit of common code to mark VNInfos for deletion.Lang Hames2010-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109388 91177308-0d34-0410-b5e6-96231b3b80d8
* Print VNInfo flags.Jakob Stoklund Olesen2010-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108277 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an assertion to make PR7542 fail consistently.Jakob Stoklund Olesen2010-07-13
| | | | | | | | | | LiveInterval::overlapsFrom dereferences end() if it is called on an empty interval. It would be reasonable to just return false - an empty interval doesn't overlap anything, but I want to know who is doing it first. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108264 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix LiveInterval::overlaps so it doesn't claim touching intervals overlap.Jakob Stoklund Olesen2010-07-13
| | | | | | Also, one binary search is enough. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108261 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove initialized but otherwise unused variables.Duncan Sands2010-06-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107127 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
* Make sure all eliminated kills are removed from VNInfo lists.Jakob Stoklund Olesen2010-06-24
| | | | | | | | This fixes PR7479 and PR7485. The test cases from those PRs are big, so not included. However, PR7485 comes from self hosting on FreeBSD, so we will surely hear about any regression. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106811 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a few VNInfo data structure checks.Jakob Stoklund Olesen2010-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106627 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce SpecificBumpPtrAllocator, a wrapper for BumpPtrAllocator which allowsBenjamin Kramer2010-03-30
| | | | | | | | only a single type of object to be allocated. Use it to make VNInfo destruction typesafe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99919 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix -Asserts warning.Daniel Dunbar2010-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99895 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r99881 with some fixes: only call destructor in releaseMemory!Torok Edwin2010-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99883 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a comment typo.Bob Wilson2010-01-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93261 91177308-0d34-0410-b5e6-96231b3b80d8
* Change errs() to dbgs().David Greene2010-01-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92528 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
* 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
* Moved some more index operations over to LiveIntervals.Lang Hames2009-09-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81605 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
* shoot a few more std::ostream print methods in the head.Chris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79814 91177308-0d34-0410-b5e6-96231b3b80d8
* Modified VNInfo. The "copy" member is now a union which holds the copy for a ↵Lang Hames2009-08-10
| | | | | | register interval, or the defining register for a stack interval. Access is via getCopy/setCopy and getReg/setReg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78620 91177308-0d34-0410-b5e6-96231b3b80d8
* More move to raw_ostream.Daniel Dunbar2009-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76966 91177308-0d34-0410-b5e6-96231b3b80d8
* Move more to raw_ostream, provide support for writing MachineBasicBlock,Daniel Dunbar2009-07-24
| | | | | | | LiveInterval, etc to raw_ostream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76965 91177308-0d34-0410-b5e6-96231b3b80d8
* Reorder if-else branches as suggested by Bill.David Greene2009-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76808 91177308-0d34-0410-b5e6-96231b3b80d8
* Make some changes suggested by Bill and Evan.David Greene2009-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76775 91177308-0d34-0410-b5e6-96231b3b80d8