summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveIntervalUnion.h
Commit message (Collapse)AuthorAge
* Simplify the interference checking code a bit.Jakob Stoklund Olesen2011-08-12
| | | | | | | This is possible now that we now longer provide an interface to iterate the interference overlaps. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137397 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the InterferenceResult class.Jakob Stoklund Olesen2011-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137381 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the last use of InterferenceResult.Jakob Stoklund Olesen2011-08-11
| | | | | | | | The Query class now holds two iterators instead of an InterferenceResult instance. The iterators are used as bookmarks for repeated collectInterferingVRegs calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137380 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove more dead code.Jakob Stoklund Olesen2011-08-11
| | | | | | | collectInterferingVRegs will be the primary function for interference checks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137354 91177308-0d34-0410-b5e6-96231b3b80d8
* Privatize an unused part of the LiveIntervalUnion::Query interface.Jakob Stoklund Olesen2011-08-11
| | | | | | No clients are iterating over interference overlaps. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137350 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some dead code.Jakob Stoklund Olesen2011-08-11
| | | | | | | | The InterferenceResult iterator turned out to be less important than we thought it would be. LiveIntervalUnion clients want higher level information, like the list of interfering virtual registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137346 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more aggressive about following hints.Jakob Stoklund Olesen2011-07-08
| | | | | | | | | | | | | | | | | | | | RAGreedy::tryAssign will now evict interference from the preferred register even when another register is free. To support this, add the EvictionCost struct that counts how many hints are broken by an eviction. We don't want to break one hint just to satisfy another. Rename canEvict to shouldEvict, and add the first bit of eviction policy that doesn't depend on spill weights: Always make room in the preferred register as long as the evictees can be split and aren't already assigned to their preferred register. Also make the CSR avoidance more accurate. When looking for a cheaper register it is OK to use a new volatile register. Only CSR aliases that have never been used before should be avoided. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134735 91177308-0d34-0410-b5e6-96231b3b80d8
* Reuse live interval union between functions. This saves a bit of compile timeJakob Stoklund Olesen2011-04-11
| | | | | | when compiling many small functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129321 91177308-0d34-0410-b5e6-96231b3b80d8
* Speed up eviction by stopping collectInterferingVRegs as soon as the spillJakob Stoklund Olesen2011-04-11
| | | | | | weight limit has been exceeded. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129305 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug found by valgrind.Jakob Stoklund Olesen2011-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128634 91177308-0d34-0410-b5e6-96231b3b80d8
* Tag cached interference with a user-provided tag instead of the virtual ↵Jakob Stoklund Olesen2011-03-16
| | | | | | | | | register number. The live range of a virtual register may change which invalidates the cached interference information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127772 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that we are deleting unused live intervals during allocation, pointers ↵Jakob Stoklund Olesen2011-03-13
| | | | | | | | may be reused. Use the virtual register number as a cache tag instead. They are not reused. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127561 91177308-0d34-0410-b5e6-96231b3b80d8
* Add tags to live interval unions to avoid using stale queries.Jakob Stoklund Olesen2011-02-09
| | | | | | | The tag is updated whenever the live interval union is changed, and it is tested before using cached information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125224 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide LiveIntervalUnion::Query::checkLoopInterference.Jakob Stoklund Olesen2010-12-17
| | | | | | | | This is a three-way interval list intersection between a virtual register, a live interval union, and a loop. It will be used to identify interference-free loops for live range splitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122034 91177308-0d34-0410-b5e6-96231b3b80d8
* Add LiveIntervalUnion print methods, RegAllocGreedy::trySplit debug spew.Jakob Stoklund Olesen2010-12-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121783 91177308-0d34-0410-b5e6-96231b3b80d8
* Use TRI::printReg instead of AbstractRegisterDescription when printingJakob Stoklund Olesen2010-12-14
| | | | | | LiveIntervalUnions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121781 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a forgotten initializer for CheckedFirstInterference.Jakob Stoklund Olesen2010-12-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121410 91177308-0d34-0410-b5e6-96231b3b80d8
* Added register reassignment prototype to RAGreedy. It's a simpleAndrew Trick2010-12-09
| | | | | | | | heuristic to reshuffle register assignments when we can't find an available reg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121388 91177308-0d34-0410-b5e6-96231b3b80d8
* IntervalMap iterators are heavyweight, so avoid copying them around and useJakob Stoklund Olesen2010-12-09
| | | | | | | | | | | references instead. Similarly, IntervalMap::begin() is almost as expensive as find(), so use find(x) instead of begin().advanceTo(x); This makes RegAllocBasic run another 5% faster. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121344 91177308-0d34-0410-b5e6-96231b3b80d8
* Move RABasic::addMBBLiveIns to the base class, it is generally useful.Jakob Stoklund Olesen2010-12-08
| | | | | | | Minor optimization to the use of IntervalMap iterators. They are fairly heavyweight, so prefer SI.valid() over SI != end(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121217 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch LiveIntervalUnion from std::set to IntervalMap.Jakob Stoklund Olesen2010-12-07
| | | | | | | This speeds up RegAllocBasic by 20%, not counting releaseMemory which becomes way faster. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121201 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused member.Jakob Stoklund Olesen2010-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121098 91177308-0d34-0410-b5e6-96231b3b80d8
* Coding style. No significant functionality. Abandon linear scan styleAndrew Trick2010-11-30
| | | | | | | | | in favor of the widespread llvm style. Capitalize variables and add newlines for visual parsing. Rename variables for readability. And other cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120490 91177308-0d34-0410-b5e6-96231b3b80d8
* Check TRI->getReservedRegs because other allocators do it. Even thoughAndrew Trick2010-11-11
| | | | | | | | | it makes no sense for allocation_order iterators to visit reserved regs. The inline spiller depends on AliasAnalysis. Manage the Query state to avoid uninitialized or stale results. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118800 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
* Adds RABasic verification and tracing.Andrew Trick2010-11-09
| | | | | | | (retry now that the windows build is green) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118630 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a trivial virtual dtor to AbstractRegisterDescription to appeaseMatt Beaumont-Gay2010-11-09
| | | | | | | -Wnon-virtual-dtor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118616 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting r118604. Windows build broke.Andrew Trick2010-11-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118613 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds RABasic verification and tracing.Andrew Trick2010-11-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118604 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds support for spilling previously allocated live intervals toAndrew Trick2010-11-08
| | | | | | | | | | handle cases in which a register is unavailable for spill code. Adds LiveIntervalUnion::extract. While processing interferences on a live virtual register, reuses the same Query object for each physcial reg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118423 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the vector of live vregs. I thought we would need to trackAndrew Trick2010-10-26
| | | | | | | | them, but hopefully we won't. And this is not the right data structure to do it anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117412 91177308-0d34-0410-b5e6-96231b3b80d8
* Jakob's review of the basic register allocator.Andrew Trick2010-10-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117384 91177308-0d34-0410-b5e6-96231b3b80d8
* This is a prototype of an experimental register allocationAndrew Trick2010-10-22
framework. It's purpose is not to improve register allocation per se, but to make it easier to develop powerful live range splitting. I call it the basic allocator because it is as simple as a global allocator can be but provides the building blocks for sophisticated register allocation with live range splitting. A minimal implementation is provided that trivially spills whenever it runs out of registers. I'm checking in now to get high-level design and style feedback. I've only done minimal testing. The next step is implementing a "greedy" allocation algorithm that does some register reassignment and makes better splitting decisions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117174 91177308-0d34-0410-b5e6-96231b3b80d8