summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocLinearScan.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Add a separate list of fixed intervals. This improves the running timeAlkis Evlogimenos2004-01-071-64/+111
| | | | | | | | | | | | | | | | | | of the register allocator as follows: before after mesa 2.3790 1.5994 vpr 2.6008 1.2078 gcc 1.9840 0.5273 mcf 0.2569 0.0470 eon 1.8468 1.4359 twolf 0.9475 0.2004 burg 1.6807 1.3300 lambda 1.2191 0.3764 Speedups range anyware from 30% to over 400% :-) llvm-svn: 10712
* Minor cleanups.Alkis Evlogimenos2004-01-071-29/+3
| | | | llvm-svn: 10711
* Remove declared but undefined method.Alkis Evlogimenos2004-01-071-5/+0
| | | | llvm-svn: 10710
* Remove simple coalescing.Alkis Evlogimenos2004-01-051-11/+0
| | | | llvm-svn: 10695
* Reserve ECX and EDI instead of EBX and EDI. Since EBX is a calleeAlkis Evlogimenos2003-12-281-8/+8
| | | | | | | | saved register it has a longer free range than ECX (which is defined every time there is a fnuction call) which makes ECX a better register to reserve. llvm-svn: 10635
* Add coalescing to register allocator. A hint is added to each intervalAlkis Evlogimenos2003-12-281-1/+12
| | | | | | | | | | | which denotes the register we would like to be assigned to (virtual or physical). In register allocation, if this hint exists and we can map it to a physical register (it is either a physical register or it is a virtual register that already got assigned to a physical one) we use that register if it is available instead of a random one in the free pool. llvm-svn: 10634
* Improve debugging output when choosing a register to spill.Alkis Evlogimenos2003-12-241-8/+3
| | | | llvm-svn: 10604
* Change the way free regusters are computed and perform betterAlkis Evlogimenos2003-12-231-130/+77
| | | | | | allocation in the presence of preallocated intervals. llvm-svn: 10595
* Remove verifyIntervals() since it doesn't actually work right now.Alkis Evlogimenos2003-12-211-52/+0
| | | | llvm-svn: 10570
* Change weight into a float so that we can take into account theAlkis Evlogimenos2003-12-211-10/+17
| | | | | | | | nesting level when computing it. Right now the allocator uses: w = sum_over_defs_uses( 10 ^ nesting level ); llvm-svn: 10569
* Add support for inactive intervals. This effectively reuses registersAlkis Evlogimenos2003-12-211-237/+323
| | | | | | for live ranges that fall into assigned registers' holes. llvm-svn: 10566
* Prune some #includesChris Lattner2003-12-181-3/+2
| | | | | | Add a statistic for # reloads llvm-svn: 10518
* Modify linear scan register allocator to use the two-addressAlkis Evlogimenos2003-12-181-76/+37
| | | | | | | instruction pass. This also fixes all remaining bugs for this new allocator to pass all tests under test/Programs. llvm-svn: 10515
* Fix bug in reserved registers. DH actually aliases DX and EDX whichAlkis Evlogimenos2003-12-181-2/+2
| | | | | | are not reserved registers. llvm-svn: 10514
* Rename LiveIntervals::expired() to LiveIntervals::expiredAt().Alkis Evlogimenos2003-12-181-1/+1
| | | | llvm-svn: 10511
* Change interface of MachineOperand as follows:Alkis Evlogimenos2003-12-141-7/+6
| | | | | | | | | | | | | | | a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse() b) add isUse(), isDef() c) rename opHiBits32() to isHiBits32(), opLoBits32() to isLoBits32(), opHiBits64() to isHiBits64(), opLoBits64() to isLoBits64(). This results to much more readable code, for example compare "op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used very often in the code. llvm-svn: 10461
* When reserving a preallocated register spill the aliases of thisAlkis Evlogimenos2003-12-131-0/+16
| | | | | | register too. llvm-svn: 10450
OpenPOWER on IntegriCloud