summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocLinearScan.cpp
Commit message (Collapse)AuthorAgeFilesLines
* - More pre-split fixes: spill slot live interval computation bug; restore ↵Evan Cheng2008-10-291-1/+1
| | | | | | | | point bug. - If a def is spilt, remember its spill index to allow its reuse. llvm-svn: 58375
* - Rewrite code that update register live interval that's split.Evan Cheng2008-10-291-1/+1
| | | | | | | - Create and update spill slot live intervals. - Lots of bug fixes. llvm-svn: 58367
* Committing a good chunk of the pre-register allocation live interval ↵Evan Cheng2008-10-231-0/+7
| | | | | | splitting pass. It's handling simple cases and appear to do good things. Next: avoid splitting an interval multiple times; renumber registers when possible; record stack slot live intervals for coloring; rematerialize defs when possible. llvm-svn: 58044
* Fix command-line option printing to print two spaces where needed,Dan Gohman2008-10-141-1/+1
| | | | | | | | | instead of requiring all "short description" strings to begin with two spaces. This makes these strings less mysterious, and it fixes some cases where short description strings mistakenly did not begin with two spaces. llvm-svn: 57521
* Add an option to enable StrongPHIElimination, for ease of testing.Owen Anderson2008-10-071-0/+3
| | | | llvm-svn: 57259
* Re-apply 56835 along with header file changes.Evan Cheng2008-09-301-2/+3
| | | | llvm-svn: 56848
* Revert commit 56835 since it breaks the build.Duncan Sands2008-09-301-3/+2
| | | | | | | | | | "If a re-materializable instruction has a register operand, the spiller will change the register operand's spill weight to HUGE_VAL to avoid it being spilled. However, if the operand is already in the queue ready to be spilled, avoid re-materializing it". llvm-svn: 56837
* If a re-materializable instruction has a register operand, the spiller will ↵Evan Cheng2008-09-301-2/+3
| | | | | | change the register operand's spill weight to HUGE_VAL to avoid it being spilled. However, if the operand is already in the queue ready to be spilled, avoid re-materializing it. llvm-svn: 56835
* Next round of earlyclobber handling. Approach theDale Johannesen2008-09-241-95/+4
| | | | | | | | | | RA problem by expanding the live interval of an earlyclobber def back one slot. Remove overlap-earlyclobber throughout. Remove earlyclobber bits and their handling from live internals. llvm-svn: 56539
* Teach coalescer about earlyclobber bits.Dale Johannesen2008-09-201-2/+5
| | | | | | Check bits for preferred register. llvm-svn: 56384
* Fix PR2808. When regalloc runs out of register, it spill a physical register ↵Evan Cheng2008-09-201-1/+4
| | | | | | around the live interval being allocated. Do not continue to try to spill another register, just grab the physical register and move on. llvm-svn: 56381
* Make earlyclobber stuff work when virtual regsDale Johannesen2008-09-191-8/+26
| | | | | | have previously been assigned conflicting physreg. llvm-svn: 56364
* Remove AsmThatEarlyClobber etc. from LiveIntervalAnalysisDale Johannesen2008-09-191-2/+71
| | | | | | | and redo as linked list walk. Logic moved into RA. Per review feedback. llvm-svn: 56326
* Somehow RegAllocLinearScan is keeping two pointers to MachineRegisterInfo.Evan Cheng2008-09-181-8/+6
| | | | llvm-svn: 56314
* Add a bit to mark operands of asm's that conflictDale Johannesen2008-09-171-2/+4
| | | | | | | | | with an earlyclobber operand elsewhere. Propagate this bit and the earlyclobber bit through SDISel. Change linear-scan RA not to allocate regs in a way that conflicts with an earlyclobber. See also comments. llvm-svn: 56290
* Fix PR2757. Ignore liveinterval register allocation preference if the ↵Evan Cheng2008-09-091-1/+1
| | | | | | preference register is not in the right register class. This can happen due to sub-register coalescing. llvm-svn: 56006
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Convert several std::vectors over to SmallVector, and use reserve() as ↵Owen Anderson2008-08-151-2/+4
| | | | | | appropriate for cases where std::vector is still used. llvm-svn: 54820
* Get rid of a use of std::map.Owen Anderson2008-08-131-2/+2
| | | | llvm-svn: 54770
* Make the allocation of LiveIntervals explicit, rather than holding them in ↵Owen Anderson2008-08-131-6/+6
| | | | | | | | the r2iMap_ by value. This will prevent references to them from being invalidated if the map is changed. llvm-svn: 54763
* Fix a compile-time regression introduced by my heuristic-changing patch. I ↵Owen Anderson2008-07-231-1/+1
| | | | | | | | | forgot to multiply the instruction count by a constant factor in a few places, which caused the register allocator to require many more iterations. llvm-svn: 53959
* Change the heuristics used in the coalescer, register allocator, and withinOwen Anderson2008-07-221-1/+2
| | | | | | | live intervals itself to use an instruction count approximation that is not affected by inserting empty indices. llvm-svn: 53937
* A brief survey of priority_queue usage in the tree turned this upDan Gohman2008-06-231-1/+1
| | | | | | as a questionable case, but the code isn't actually needed. llvm-svn: 52657
* Enhanced heuristic to determine the *best* register to spill. Instead of ↵Evan Cheng2008-06-201-66/+176
| | | | | | | | picking the register with the lowest spill weight. Consider (up to) 2 additional registers with spill weights that are close to the lowest spill weight. The one with fewest defs and uses that conflicts with the current interval (weighted by loop depth) is the spill candidate. This is not always a win, but there are much more wins than loses and wins tend to be more noticeable. llvm-svn: 52554
* Refine stack slot interval weight computation.Evan Cheng2008-06-061-8/+13
| | | | llvm-svn: 52040
* Add a stack slot coloring pass. Not yet enabled.Evan Cheng2008-06-041-1/+32
| | | | llvm-svn: 51934
* Do not add empty live intervals to handled_. They should never be undone for ↵Evan Cheng2008-04-111-2/+1
| | | | | | backtracking. llvm-svn: 49544
* Special handling of zero-sized live intervals.Evan Cheng2008-04-031-5/+19
| | | | llvm-svn: 49167
* Add an assertion to catch register of illegal class.Evan Cheng2008-03-241-0/+1
| | | | llvm-svn: 48751
* Undo tweak. It had no obvious benefit.Evan Cheng2008-03-131-19/+4
| | | | llvm-svn: 48341
* When the register allocator runs out of registers, spill a physical register ↵Evan Cheng2008-03-111-2/+22
| | | | | | around the def's and use's of the interval being allocated to make it possible for the interval to target a register and spill it right away and restore a register for uses. This likely generates terrible code but is before than aborting. llvm-svn: 48218
* Temporarily revert 48175.Evan Cheng2008-03-111-7/+1
| | | | llvm-svn: 48204
* If the register allocator ran out of registers, just abort for now.Evan Cheng2008-03-101-1/+7
| | | | llvm-svn: 48175
* Use a smallvector for inactiveCounts and initialize it lazily Chris Lattner2008-02-261-4/+10
| | | | | | | | instead of init'ing it maximally to zeros on entry. getFreePhysReg is pretty hot and only a few elements are typically used. This speeds up linscan by 5% on 176.gcc. llvm-svn: 47631
* Rename PrintableName to Name.Bill Wendling2008-02-261-6/+6
| | | | llvm-svn: 47629
* Change "Name" to "AsmName" in the target register info. Gee, a refactoring toolBill Wendling2008-02-261-6/+7
| | | | | | would have been a Godsend here! llvm-svn: 47625
* Fix newly-introduced 4.3 warningsAnton Korobeynikov2008-02-201-2/+4
| | | | llvm-svn: 47375
* Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman2008-02-101-46/+46
| | | | llvm-svn: 46930
* Don't recalculate the loop info and loop dominators analyses if they'reBill Wendling2008-01-041-0/+2
| | | | | | preserved. llvm-svn: 45596
* Rename SSARegMap -> MachineRegisterInfo in keeping with the idea Chris Lattner2007-12-311-9/+9
| | | | | | | | | | | | | | that "machine" classes are used to represent the current state of the code being compiled. Given this expanded name, we can start moving other stuff into it. For now, move the UsedPhysRegs and LiveIn/LoveOuts vectors from MachineFunction into it. Update all the clients to match. This also reduces some needless #includes, such as MachineModuleInfo from MachineFunction. llvm-svn: 45467
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Switch over to MachineLoopInfo.Evan Cheng2007-12-111-4/+4
| | | | llvm-svn: 44838
* Live interval splitting:Evan Cheng2007-11-171-5/+13
| | | | | | | | | | | | | | | | | | | When a live interval is being spilled, rather than creating short, non-spillable intervals for every def / use, split the interval at BB boundaries. That is, for every BB where the live interval is defined or used, create a new interval that covers all the defs and uses in the BB. This is designed to eliminate one common problem: multiple reloads of the same value in a single basic block. Note, it does *not* decrease the number of spills since no copies are inserted so the split intervals are *connected* through spill and reloads (or rematerialization). The newly created intervals can be spilled again, in that case, since it does not span multiple basic blocks, it's spilled in the usual manner. However, it can reuse the same stack slot as the previously split interval. This is currently controlled by -split-intervals-at-bb. llvm-svn: 44198
* Adding debug output during coalescing.Bill Wendling2007-11-151-0/+1
| | | | llvm-svn: 44154
* Need to increment the iterator.Bill Wendling2007-11-151-1/+1
| | | | llvm-svn: 44153
* Refactor some code.Evan Cheng2007-11-121-3/+3
| | | | llvm-svn: 44010
* If an interval is being undone clear its preference as well since the source ↵Evan Cheng2007-11-041-1/+6
| | | | | | interval may have been undone as well. llvm-svn: 43670
* There are times when the coalescer would not coalesce away a copy but the copyEvan Cheng2007-11-031-9/+89
| | | | | | | | | | | | | | | | can be eliminated by the allocator is the destination and source targets the same register. The most common case is when the source and destination registers are in different class. For example, on x86 mov32to32_ targets GR32_ which contains a subset of the registers in GR32. The allocator can do 2 things: 1. Set the preferred allocation for the destination of a copy to that of its source. 2. After allocation is done, change the allocation of a copy destination (if legal) so the copy can be eliminated. This eliminates 443 extra moves from 403.gcc. llvm-svn: 43662
* Apply Chris' suggestions.Evan Cheng2007-10-171-1/+2
| | | | llvm-svn: 43069
* Clean up code that calculate MBB live-in's.Evan Cheng2007-10-171-17/+19
| | | | llvm-svn: 43061
OpenPOWER on IntegriCloud