aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/VirtRegMap.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* More cleanups for MachineOperand:Chris Lattner2007-12-301-2/+2
| | | | | | | | | | | - Eliminate the static "print" method for operands, moving it into MachineOperand::print. - Change various set* methods for register flags to take a bool for the value to set it to. Remove unset* methods. - Group methods more logically by operand flavor in MachineOperand.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45461 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* If deleting a reload instruction due to reuse (value is available in ↵Evan Cheng2007-12-111-2/+18
| | | | | | register R and reload is targeting R), make sure to invalidate the kill information of the last kill. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44894 91177308-0d34-0410-b5e6-96231b3b80d8
* MachineInstr can change. Store indexes instead.Evan Cheng2007-12-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44612 91177308-0d34-0410-b5e6-96231b3b80d8
* If a split live interval is spilled again, remove the kill marker on its ↵Evan Cheng2007-12-051-1/+2
| | | | | | last use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44611 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix kill info for split intervals.Evan Cheng2007-12-051-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44609 91177308-0d34-0410-b5e6-96231b3b80d8
* - Mark last use of a split interval as kill instead of letting spiller track it.Evan Cheng2007-12-051-2/+0
| | | | | | | | | | This allows an important optimization to be re-enabled. - If all uses / defs of a split interval can be folded, give the interval a low spill weight so it would not be picked in case spilling is needed (avoid pushing other intervals in the same BB to be spilled). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44601 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a argument to storeRegToStackSlot and storeRegToAddr to specify whetherEvan Cheng2007-12-051-11/+7
| | | | | | | the stored register is killed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44600 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a unsafe optimization. This fixes 401.bzip2.Evan Cheng2007-12-041-8/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44587 91177308-0d34-0410-b5e6-96231b3b80d8
* Spiller unfold optimization bug: do not clobber a reusable stack slot value ↵Evan Cheng2007-12-041-10/+16
| | | | | | unless it can be modified. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44575 91177308-0d34-0410-b5e6-96231b3b80d8
* Bug fixes.Evan Cheng2007-12-031-7/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44549 91177308-0d34-0410-b5e6-96231b3b80d8
* Update kill info for uses of split intervals.Evan Cheng2007-12-031-8/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44531 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove redundant foldMemoryOperand variants and other code clean up.Evan Cheng2007-12-021-14/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44517 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed various live interval splitting bugs / compile time issues.Evan Cheng2007-11-291-47/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44428 91177308-0d34-0410-b5e6-96231b3b80d8
* Recover compile time regression.Evan Cheng2007-11-281-21/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44386 91177308-0d34-0410-b5e6-96231b3b80d8
* Live interval splitting:Evan Cheng2007-11-171-55/+143
| | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44198 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up sub-register implementation by moving subReg information back toEvan Cheng2007-11-141-24/+11
| | | | | | | | | | | | MachineOperand auxInfo. Previous clunky implementation uses an external map to track sub-register uses. That works because register allocator uses a new virtual register for each spilled use. With interval splitting (coming soon), we may have multiple uses of the same register some of which are of using different sub-registers from others. It's too fragile to constantly update the information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44104 91177308-0d34-0410-b5e6-96231b3b80d8
* One more extract_subreg coalescing bug.Evan Cheng2007-11-021-5/+33
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43644 91177308-0d34-0410-b5e6-96231b3b80d8
* - Only perform the unfolding optimization when the folding in question is ↵Evan Cheng2007-10-221-5/+2
| | | | | | | | | modref. - Remove a bogus assertion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43211 91177308-0d34-0410-b5e6-96231b3b80d8
* Local spiller optimization:Evan Cheng2007-10-191-139/+243
| | | | | | | | | | | | | | | | | Turn a store folding instruction into a load folding instruction. e.g. xorl %edi, %eax movl %eax, -32(%ebp) movl -36(%ebp), %eax orl %eax, -32(%ebp) => xorl %edi, %eax orl -36(%ebp), %eax mov %eax, -32(%ebp) This enables the unfolding optimization for a subsequent instruction which will also eliminate the newly introduced store instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43192 91177308-0d34-0410-b5e6-96231b3b80d8
* Local spiller optimization: Evan Cheng2007-10-131-4/+50
| | | | | | | | | | | | | | | | | | | | Turn this: movswl %ax, %eax movl %eax, -36(%ebp) xorl %edi, -36(%ebp) into movswl %ax, %eax xorl %edi, %eax movl %eax, -36(%ebp) by unfolding the load / store xorl into an xorl and a store when we know the value in the spill slot is available in a register. This doesn't change the number of instructions but reduce the number of times memory is accessed. Also unfold some load folding instructions and reuse the value when similar situation presents itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42947 91177308-0d34-0410-b5e6-96231b3b80d8
* EXTRACT_SUBREG coalescing support. The coalescer now treats EXTRACT_SUBREG likeEvan Cheng2007-10-121-38/+70
| | | | | | | | | | (almost) a register copy. However, it always coalesced to the register of the RHS (the super-register). All uses of the result of a EXTRACT_SUBREG are sub- register uses which adds subtle complications to load folding, spiller rewrite, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42899 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow copyRegToReg to emit cross register classes copies.Evan Cheng2007-09-261-3/+4
| | | | | | | Tested with "make check"! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42346 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove isReg, isImm, and isMBB, and change all their users to use Dan Gohman2007-09-141-6/+6
| | | | | | | | isRegister, isImmediate, and isMachineBasicBlock, which are equivalent, and more popular. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41958 91177308-0d34-0410-b5e6-96231b3b80d8
* Add instruction dump output. This helps find bugs.David Greene2007-09-061-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41744 91177308-0d34-0410-b5e6-96231b3b80d8
* If the source of a move is in spill slot, the reload may be folded to ↵Evan Cheng2007-08-151-13/+19
| | | | | | essentially a load from stack slot. It's ok to mark the stack slot value as available for reuse. But it should not be clobbered since the destination of the move is live. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41109 91177308-0d34-0410-b5e6-96231b3b80d8
* - If a def is dead, do not spill it.Evan Cheng2007-08-141-61/+115
| | | | | | | | - If the defs of a spilled rematerializable MI are dead after the spill store is deleted, delete the def MI as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41086 91177308-0d34-0410-b5e6-96231b3b80d8
* If a MI's def is remat as well as spilled, and the store is later deemed ↵Evan Cheng2007-08-141-2/+29
| | | | | | dead, mark the def operand as isDead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41083 91177308-0d34-0410-b5e6-96231b3b80d8
* If a spilled value is being reused and the use is a kill, that means there areEvan Cheng2007-08-141-18/+32
| | | | | | | | no more uses within the MBB and the spilled value isn't live out of the MBB. Then it's safe to delete the spill store. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41069 91177308-0d34-0410-b5e6-96231b3b80d8
* If a rematerializable def is not deleted, i.e. it is also spilled, check if theEvan Cheng2007-08-141-11/+20
| | | | | | | spilled value is available for reuse. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41067 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-implement trivial rematerialization. This allows def MIs whose live ↵Evan Cheng2007-08-131-128/+118
| | | | | | intervals that are coalesced to be rematerialized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41060 91177308-0d34-0410-b5e6-96231b3b80d8
* Missed a couple of places where new instructions are added due to spill / ↵Evan Cheng2007-07-111-67/+77
| | | | | | restore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39748 91177308-0d34-0410-b5e6-96231b3b80d8
* No longer need to track last def / use.Evan Cheng2007-07-111-79/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38534 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR1545: Revamp code that update kill information due to register reuse.Evan Cheng2007-07-111-63/+85
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38525 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace M_REMATERIALIZIBLE and the newly-added isOtherReMaterializableLoadDan Gohman2007-06-191-3/+2
| | | | | | | | | | | with a general target hook to identify rematerializable instructions. Some instructions are only rematerializable with specific operands, such as loads from constant pools, while others are always rematerializable. This hook allows both to be identified as being rematerializable with the same mechanism. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37644 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a target hook to allow loads from constant pools to be rematerialized, ↵Dan Gohman2007-06-141-1/+2
| | | | | | | | | and an implementation for x86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37576 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename findRegisterUseOperand to findRegisterUseOperandIdx to avoid confusion.Evan Cheng2007-04-261-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36483 91177308-0d34-0410-b5e6-96231b3b80d8
* Match MachineFunction::UsedPhysRegs changes.Evan Cheng2007-04-251-19/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36452 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-materialize all loads from fixed stack slots.Evan Cheng2007-04-041-6/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35660 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't add the same MI to register reuse "last def/use" twice if it reads theEvan Cheng2007-03-301-1/+4
| | | | | | | register more than once. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35513 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't call getOperandConstraint() if operand index is greater thanEvan Cheng2007-03-271-1/+2
| | | | | | | TID->numOperands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35375 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR1266. Don't mark a two address operand IsKill.Evan Cheng2007-03-261-19/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35365 91177308-0d34-0410-b5e6-96231b3b80d8
* First cut trivial re-materialization support.Evan Cheng2007-03-201-12/+68
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35208 91177308-0d34-0410-b5e6-96231b3b80d8
* Only propagate IsKill if the last use is a kill.Evan Cheng2007-03-031-8/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34878 91177308-0d34-0410-b5e6-96231b3b80d8
* - Keep track all def and uses of stack slot available in register.Evan Cheng2007-03-021-28/+51
| | | | | | | - Available value use may be deleted (e.g. noop move). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34841 91177308-0d34-0410-b5e6-96231b3b80d8
* Invalidate last use of a reused register if the use is a deleted noop copy.Evan Cheng2007-03-021-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34839 91177308-0d34-0410-b5e6-96231b3b80d8
* A restore is promoted to copy (or deleted entirely), remove the kill from ↵Evan Cheng2007-03-011-3/+4
| | | | | | the last use of the targetted register. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34773 91177308-0d34-0410-b5e6-96231b3b80d8
* A couple of more places where a register liveness has been extended and its ↵Evan Cheng2007-02-251-5/+57
| | | | | | last kill should be updated accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34597 91177308-0d34-0410-b5e6-96231b3b80d8
* Reuse extends the liveness of a register. Transfer the kill to the operand ↵Evan Cheng2007-02-231-1/+6
| | | | | | that reuse it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34536 91177308-0d34-0410-b5e6-96231b3b80d8
* A spill kills the register being stored. But it is later being reused by ↵Evan Cheng2007-02-231-25/+39
| | | | | | spiller, its live range has to be extended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34517 91177308-0d34-0410-b5e6-96231b3b80d8