aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RegAllocLinearScan.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add some comments to the backtracking code.Alkis Evlogimenos2004-07-251-2/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15200 91177308-0d34-0410-b5e6-96231b3b80d8
* Change std::map<unsigned, LiveInterval*> into a std::map<unsigned,Alkis Evlogimenos2004-07-241-3/+3
| | | | | | | | LiveInterval>. This saves some space and removes the pointer indirection caused by following the pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15167 91177308-0d34-0410-b5e6-96231b3b80d8
* Completely eliminate the intervals_ list. instead, the r2iMap_ maintainsChris Lattner2004-07-241-9/+8
| | | | | | | ownership of the intervals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15155 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename LiveIntervals.(cpp|h) -> LiveIntervalAnalysis.(cpp|h)Chris Lattner2004-07-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15135 91177308-0d34-0410-b5e6-96231b3b80d8
* Some compile time improvements resulting in a 1sec speedup in the 5secAlkis Evlogimenos2004-07-221-75/+53
| | | | | | | | | | | | compilation of gcc: * Use vectors instead of lists for the intervals sets * Use a heap for the unhandled set to keep intervals always sorted and makes insertions back to the heap very fast (compared to scanning a list) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15103 91177308-0d34-0410-b5e6-96231b3b80d8
* These files don't need to include <iostream> since they include ↵Brian Gaeke2004-07-211-1/+0
| | | | | | "Support/Debug.h". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15089 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code.Alkis Evlogimenos2004-07-191-17/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15011 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix assertion to not dereference end!Chris Lattner2004-07-191-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14991 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some asserts that the list of intervals returned by addIntervalsForSpillsChris Lattner2004-07-191-6/+30
| | | | | | | | is sorted. This is not the case currently, which is causing no end of problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14990 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly compute the ration of iterations/#intervals.Alkis Evlogimenos2004-07-041-2/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14626 91177308-0d34-0410-b5e6-96231b3b80d8
* Add efficiency statistic.Alkis Evlogimenos2004-07-041-1/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14590 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename Interval class to LiveInterval to avoid conflicting with the alreadyChris Lattner2004-06-211-10/+10
| | | | | | | | | | existing llvm::Interval class. Patch contributed by Vladimir Prus! http://mail.cs.uiuc.edu/pipermail/llvmbugs/2004-June/000710.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14281 91177308-0d34-0410-b5e6-96231b3b80d8
* Pull Interval class out of LiveIntervals.Alkis Evlogimenos2004-05-301-11/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13910 91177308-0d34-0410-b5e6-96231b3b80d8
* When spilling an register, introduce a new temporary for each of itsAlkis Evlogimenos2004-05-301-40/+46
| | | | | | | | spills. This allows for more flexibility when allocating registers for spill code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13907 91177308-0d34-0410-b5e6-96231b3b80d8
* Add required headerAlkis Evlogimenos2004-05-081-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13417 91177308-0d34-0410-b5e6-96231b3b80d8
* numeric_limits::infinity() apparently does not work on all systems. As aChris Lattner2004-05-061-1/+1
| | | | | | | workaround, use the C HUGE_VAL macro instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13377 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the set of fixed (preallocated) intervals be a fixed superset ofAlkis Evlogimenos2004-03-171-29/+10
| | | | | | | | unhandled + handled. So unhandled is now including all fixed intervals and fixed intervals never changes when processing a function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12462 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a spiller option to llc. A simple spiller will come soon. When we get ↵Alkis Evlogimenos2004-03-011-1/+3
| | | | | | CFG in the machine code represenation a global spiller will also be possible. Also document the linear scan register allocator but mark it as experimental for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12062 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the long awaited memory operand folding support for linear scanAlkis Evlogimenos2004-03-011-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12058 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename member function to be consistent with the rest.Alkis Evlogimenos2004-02-271-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11898 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove asssert since it is breaking cases that it shouldn't.Alkis Evlogimenos2004-02-251-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11841 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an assertionChris Lattner2004-02-251-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11830 91177308-0d34-0410-b5e6-96231b3b80d8
* Move machine code rewriter and spiller outside the registerAlkis Evlogimenos2004-02-241-141/+15
| | | | | | | | | | | | allocator. The implementation is completely rewritten and now employs several optimizations not exercised before. For example for 164.gzip we have 997 loads and 699 stores vs the 1221 loads and 880 stores we have before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11798 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove '4Virt' from member function names as it is obvious.Alkis Evlogimenos2004-02-231-12/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11781 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor VirtRegMap out of RegAllocLinearScan as the first part of bugAlkis Evlogimenos2004-02-231-136/+45
| | | | | | | 251 (providing a generic machine code rewriter/spiller). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11780 91177308-0d34-0410-b5e6-96231b3b80d8
* Add number of spilled registers statistic.Alkis Evlogimenos2004-02-231-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11759 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove implementation of default constructor as it is useless now.Alkis Evlogimenos2004-02-231-5/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11755 91177308-0d34-0410-b5e6-96231b3b80d8
* Improved PhysRegTracker interface. RegAlloc lazily allocates the register ↵Alkis Evlogimenos2004-02-231-17/+17
| | | | | | tracker using a std::auto_ptr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11738 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comments in PhysRegTracker and rename isPhysRegAvail to isRegAvail to be ↵Alkis Evlogimenos2004-02-231-1/+1
| | | | | | consistent with the other two git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11723 91177308-0d34-0410-b5e6-96231b3b80d8
* Pull PhysRegTracker out of RegAllocLinearScan as it can be used by other ↵Alkis Evlogimenos2004-02-231-59/+13
| | | | | | allocators as well git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11720 91177308-0d34-0410-b5e6-96231b3b80d8
* Move LiveIntervals.h to lib/CodeGen since it shouldn't be exposed to other ↵Alkis Evlogimenos2004-02-231-1/+3
| | | | | | parts of the compiler git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11719 91177308-0d34-0410-b5e6-96231b3b80d8
* Print basic block boundaries in machine instruction debug output.Alkis Evlogimenos2004-02-221-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11704 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash in debug output.Alkis Evlogimenos2004-02-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11659 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix instruction numbering in debug output.Alkis Evlogimenos2004-02-201-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11655 91177308-0d34-0410-b5e6-96231b3b80d8
* Too many changes in one commit:Alkis Evlogimenos2004-02-201-97/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | 1. LiveIntervals now implement a 4 slot per instruction model. Load, Use, Def and a Store slot. This is required in order to correctly represent caller saved register clobbering on function calls, register reuse in the same instruction (def resues last use) and also spill code added later by the allocator. The previous representation (2 slots per instruction) was insufficient and as a result was causing subtle bugs. 2. Fixes in spill code generation. This was the major cause of failures in the test suite. 3. Linear scan now has core support for folding memory operands. This is untested and not enabled (the live interval update function does not attempt to fold loads/stores in instructions). 4. Lots of improvements in the debugging output of both live intervals and linear scan. Give it a try... it is beautiful :-) In summary the above fixes all the issues with the recent reserved register elimination changes and get the allocator very close to the next big step: folding memory operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11654 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix RA::verifyAssignment()Alkis Evlogimenos2004-02-191-4/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11629 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename reloads/spills to loads/stores.Alkis Evlogimenos2004-02-191-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11619 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement assignment correctness verification.Alkis Evlogimenos2004-02-181-0/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11609 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the use of spill (reserved) registers.Alkis Evlogimenos2004-02-151-303/+214
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11476 91177308-0d34-0410-b5e6-96231b3b80d8
* Use std::numeric_limits<float>::infinity() instead ofAlkis Evlogimenos2004-02-141-1/+1
| | | | | | | | std::numeric_limits<float>::max() for weighting preallocated intervals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11427 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove getAllocatedRegNum(). Use getReg() instead.Alkis Evlogimenos2004-02-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11393 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MachineBasicBlock's vector of MachineInstr pointers into anAlkis Evlogimenos2004-02-121-11/+10
| | | | | | | | | | ilist of MachineInstr objects. This allows constant time removal and insertion of MachineInstr instances from anywhere in each MachineBasicBlock. It also allows for constant time splicing of MachineInstrs into or out of MachineBasicBlocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11340 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use MachineOperand::isVirtualRegister either!Chris Lattner2004-02-101-5/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11283 91177308-0d34-0410-b5e6-96231b3b80d8
* Increase code clarity.Alkis Evlogimenos2004-02-061-127/+100
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11151 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate uneeded lookups by passing a Virt2PhysMap::iterator insteadAlkis Evlogimenos2004-02-061-23/+33
| | | | | | | of the virtual register to certain functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11143 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify the two address instruction pass to remove the duplicateAlkis Evlogimenos2004-02-041-29/+27
| | | | | | | operand of the instruction and thus simplify the register allocation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11124 91177308-0d34-0410-b5e6-96231b3b80d8
* When an instruction like: A += B had both A and B virtual registersAlkis Evlogimenos2004-02-031-10/+6
| | | | | | | spilled, A was loaded from its stack location twice. This fixes the bug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11093 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix debugging output.Alkis Evlogimenos2004-02-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11088 91177308-0d34-0410-b5e6-96231b3b80d8
* Create an object for tracking physical register usage. This will lookAlkis Evlogimenos2004-02-021-106/+116
| | | | | | | much better when I get rid of the reserved registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11066 91177308-0d34-0410-b5e6-96231b3b80d8
* Change weight array into a vector and make it as big as the number ofAlkis Evlogimenos2004-02-011-17/+25
| | | | | | | | | | | | registers (not as the max number of registers). Change toSpill from a std::set into a std::vector<bool>. Use the reverse iterator adapter to do a reverse scan of allocatable registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11061 91177308-0d34-0410-b5e6-96231b3b80d8