summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocLinearScan.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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 llvm-svn: 14281
* Pull Interval class out of LiveIntervals.Alkis Evlogimenos2004-05-301-11/+12
| | | | llvm-svn: 13910
* 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. llvm-svn: 13907
* Add required headerAlkis Evlogimenos2004-05-081-0/+1
| | | | llvm-svn: 13417
* 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. llvm-svn: 13377
* 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. llvm-svn: 12462
* 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. llvm-svn: 12062
* Add the long awaited memory operand folding support for linear scanAlkis Evlogimenos2004-03-011-3/+3
| | | | llvm-svn: 12058
* Rename member function to be consistent with the rest.Alkis Evlogimenos2004-02-271-3/+3
| | | | llvm-svn: 11898
* Remove asssert since it is breaking cases that it shouldn't.Alkis Evlogimenos2004-02-251-1/+0
| | | | llvm-svn: 11841
* Add an assertionChris Lattner2004-02-251-0/+1
| | | | llvm-svn: 11830
* 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. llvm-svn: 11798
* Remove '4Virt' from member function names as it is obvious.Alkis Evlogimenos2004-02-231-12/+12
| | | | llvm-svn: 11781
* Refactor VirtRegMap out of RegAllocLinearScan as the first part of bugAlkis Evlogimenos2004-02-231-136/+45
| | | | | | 251 (providing a generic machine code rewriter/spiller). llvm-svn: 11780
* Add number of spilled registers statistic.Alkis Evlogimenos2004-02-231-0/+2
| | | | llvm-svn: 11759
* Remove implementation of default constructor as it is useless now.Alkis Evlogimenos2004-02-231-5/+0
| | | | llvm-svn: 11755
* Improved PhysRegTracker interface. RegAlloc lazily allocates the register ↵Alkis Evlogimenos2004-02-231-17/+17
| | | | | | tracker using a std::auto_ptr llvm-svn: 11738
* Fix comments in PhysRegTracker and rename isPhysRegAvail to isRegAvail to be ↵Alkis Evlogimenos2004-02-231-1/+1
| | | | | | consistent with the other two llvm-svn: 11723
* Pull PhysRegTracker out of RegAllocLinearScan as it can be used by other ↵Alkis Evlogimenos2004-02-231-59/+13
| | | | | | allocators as well llvm-svn: 11720
* Move LiveIntervals.h to lib/CodeGen since it shouldn't be exposed to other ↵Alkis Evlogimenos2004-02-231-1/+3
| | | | | | parts of the compiler llvm-svn: 11719
* Print basic block boundaries in machine instruction debug output.Alkis Evlogimenos2004-02-221-0/+1
| | | | llvm-svn: 11704
* Fix crash in debug output.Alkis Evlogimenos2004-02-201-1/+1
| | | | llvm-svn: 11659
* Fix instruction numbering in debug output.Alkis Evlogimenos2004-02-201-1/+2
| | | | llvm-svn: 11655
* 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. llvm-svn: 11654
* Fix RA::verifyAssignment()Alkis Evlogimenos2004-02-191-4/+8
| | | | llvm-svn: 11629
* Rename reloads/spills to loads/stores.Alkis Evlogimenos2004-02-191-5/+5
| | | | llvm-svn: 11619
* Implement assignment correctness verification.Alkis Evlogimenos2004-02-181-0/+15
| | | | llvm-svn: 11609
* Eliminate the use of spill (reserved) registers.Alkis Evlogimenos2004-02-151-303/+214
| | | | llvm-svn: 11476
* Use std::numeric_limits<float>::infinity() instead ofAlkis Evlogimenos2004-02-141-1/+1
| | | | | | | std::numeric_limits<float>::max() for weighting preallocated intervals. llvm-svn: 11427
* Remove getAllocatedRegNum(). Use getReg() instead.Alkis Evlogimenos2004-02-131-1/+1
| | | | llvm-svn: 11393
* 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. llvm-svn: 11340
* Do not use MachineOperand::isVirtualRegister either!Chris Lattner2004-02-101-5/+8
| | | | llvm-svn: 11283
* Increase code clarity.Alkis Evlogimenos2004-02-061-127/+100
| | | | llvm-svn: 11151
* Eliminate uneeded lookups by passing a Virt2PhysMap::iterator insteadAlkis Evlogimenos2004-02-061-23/+33
| | | | | | of the virtual register to certain functions. llvm-svn: 11143
* 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. llvm-svn: 11124
* 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. llvm-svn: 11093
* Fix debugging output.Alkis Evlogimenos2004-02-021-1/+1
| | | | llvm-svn: 11088
* 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. llvm-svn: 11066
* 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. llvm-svn: 11061
* Use std::map::count() instead of std::map::find() != std::map::end()Alkis Evlogimenos2004-02-011-5/+3
| | | | | | where appropriate. llvm-svn: 11060
* Use MRegisterInfo::isPhysicalRegister andAlkis Evlogimenos2004-02-011-22/+22
| | | | | | MRegisterInfo::isVirtualRegister. llvm-svn: 11045
* Add option to join live intervals. Two intervals are joined if thereAlkis Evlogimenos2004-01-221-4/+63
| | | | | | | | | | | | | | is a move between two registers, at least one of the registers is virtual and the two live intervals do not overlap. This results in about 40% reduction in intervals, 30% decrease in the register allocators running time and a 20% increase in peephole optimizations (mainly move eliminations). The option can be enabled by passing -join-liveintervals where appropriate. llvm-svn: 10965
* Remove unneeded check. An interval in active, by definition overlapsAlkis Evlogimenos2004-01-221-4/+1
| | | | | | with the current one. llvm-svn: 10959
* Improve debugging output. Remove unneeded virtReg->0 mapping whenAlkis Evlogimenos2004-01-221-20/+31
| | | | | | | | virtReg lives on the stack. Now a virtual register has an entry in the virtual->physical map or the virtual->stack slot map but never in both. llvm-svn: 10958
* Handle printing of intervals that are not assign to any physicalAlkis Evlogimenos2004-01-161-1/+1
| | | | | | register yet (2nd try). llvm-svn: 10896
* Handle printing of intervals that are not assign to any physicalAlkis Evlogimenos2004-01-161-6/+7
| | | | | | register yet. llvm-svn: 10895
* Fold open interval ends handling intoAlkis Evlogimenos2004-01-161-10/+4
| | | | | | LiveIntervals::Interval::expiredAt() and simplify regalloc code. llvm-svn: 10894
* Improve debugging output.Alkis Evlogimenos2004-01-141-2/+3
| | | | llvm-svn: 10834
* Indentation and whitespace cleanups.Alkis Evlogimenos2004-01-131-9/+9
| | | | llvm-svn: 10820
* Fix bug introduced by previous commit: check if fixed intervalsAlkis Evlogimenos2004-01-131-0/+3
| | | | | | overlap before adding their spill weight. llvm-svn: 10819
OpenPOWER on IntegriCloud