summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/VirtRegMap.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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. llvm-svn: 44104
* One more extract_subreg coalescing bug.Evan Cheng2007-11-021-5/+33
| | | | llvm-svn: 43644
* - Only perform the unfolding optimization when the folding in question is ↵Evan Cheng2007-10-221-5/+2
| | | | | | | | modref. - Remove a bogus assertion. llvm-svn: 43211
* 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. llvm-svn: 43192
* 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. llvm-svn: 42947
* 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. llvm-svn: 42899
* Allow copyRegToReg to emit cross register classes copies.Evan Cheng2007-09-261-3/+4
| | | | | | Tested with "make check"! llvm-svn: 42346
* 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. llvm-svn: 41958
* Add instruction dump output. This helps find bugs.David Greene2007-09-061-0/+6
| | | | llvm-svn: 41744
* 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. llvm-svn: 41109
* - 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. llvm-svn: 41086
* 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. llvm-svn: 41083
* 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. llvm-svn: 41069
* 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. llvm-svn: 41067
* Re-implement trivial rematerialization. This allows def MIs whose live ↵Evan Cheng2007-08-131-128/+118
| | | | | | intervals that are coalesced to be rematerialized. llvm-svn: 41060
* Missed a couple of places where new instructions are added due to spill / ↵Evan Cheng2007-07-111-67/+77
| | | | | | restore. llvm-svn: 39748
* No longer need to track last def / use.Evan Cheng2007-07-111-79/+15
| | | | llvm-svn: 38534
* Fix for PR1545: Revamp code that update kill information due to register reuse.Evan Cheng2007-07-111-63/+85
| | | | llvm-svn: 38525
* 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. llvm-svn: 37644
* Add a target hook to allow loads from constant pools to be rematerialized, ↵Dan Gohman2007-06-141-1/+2
| | | | | | | | and an implementation for x86. llvm-svn: 37576
* Rename findRegisterUseOperand to findRegisterUseOperandIdx to avoid confusion.Evan Cheng2007-04-261-5/+5
| | | | llvm-svn: 36483
* Match MachineFunction::UsedPhysRegs changes.Evan Cheng2007-04-251-19/+12
| | | | llvm-svn: 36452
* Re-materialize all loads from fixed stack slots.Evan Cheng2007-04-041-6/+18
| | | | llvm-svn: 35660
* 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. llvm-svn: 35513
* Don't call getOperandConstraint() if operand index is greater thanEvan Cheng2007-03-271-1/+2
| | | | | | TID->numOperands. llvm-svn: 35375
* Fix for PR1266. Don't mark a two address operand IsKill.Evan Cheng2007-03-261-19/+30
| | | | llvm-svn: 35365
* First cut trivial re-materialization support.Evan Cheng2007-03-201-12/+68
| | | | llvm-svn: 35208
* Only propagate IsKill if the last use is a kill.Evan Cheng2007-03-031-8/+22
| | | | llvm-svn: 34878
* - 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). llvm-svn: 34841
* Invalidate last use of a reused register if the use is a deleted noop copy.Evan Cheng2007-03-021-0/+1
| | | | llvm-svn: 34839
* 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. llvm-svn: 34773
* 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. llvm-svn: 34597
* Reuse extends the liveness of a register. Transfer the kill to the operand ↵Evan Cheng2007-02-231-1/+6
| | | | | | that reuse it. llvm-svn: 34536
* 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. llvm-svn: 34517
* Use BitVector instead. No functionality change.Evan Cheng2007-02-211-8/+5
| | | | llvm-svn: 34460
* Dead code.Evan Cheng2007-02-201-6/+0
| | | | llvm-svn: 34435
* Fixed a long standing spiller bug that's exposed by Thumb:Evan Cheng2007-02-081-13/+13
| | | | | | | | | | | | | | | | | | | | | | | The code sequence before the spiller is something like: = tMOVrr %reg1117 = tMOVrr %reg1078 = tLSLri %reg1117, 2 The it starts spilling: %r0 = tRestore <fi#5>, 0 %r1 = tRestore <fi#7>, 0 %r1 = tMOVrr %r1<kill> tSpill %r1, <fi#5>, 0 %reg1078 = tLSLri %reg1117, 2 It restores the value while processing the first tMOVrr. At this point, the spiller remembers fi#5 is available in %r0. Next it processes the second move. It restores the source before the move and spills the result afterwards. The move becomes a noop and is deleted. However, a spill has been inserted and that should invalidate reuse of %r0 for fi#5 and add reuse of %r1 for fi#5. Therefore, %reg1117 (which is also assigned fi#5) should get %r1, not %r0. llvm-svn: 34039
* Switch this to use SmallSet to avoid mallocs in the common case.Chris Lattner2007-01-231-3/+3
| | | | llvm-svn: 33457
* GetRegForReload() now keeps track which registers have been considered and ↵Evan Cheng2007-01-191-8/+32
| | | | | | | | | | | | | | rejected during its quest to find a suitable reload register. This avoids an infinite loop in case like this: t1 := op t2, t3 t2 <- assigned r0 for use by the reload but ended up reuse r1 t3 <- assigned r1 for use by the reload but ended up reuse r0 t1 <- desires r1 sees r1 is taken by t2, tries t2's reload register r0 sees r0 is taken by t3, tries t3's reload register r1 sees r1 is taken by t2, tries t2's reload register r0 ... llvm-svn: 33382
* Eliminate static ctors from StatisticsChris Lattner2006-12-191-7/+7
| | | | llvm-svn: 32698
* Added an automatic cast to "std::ostream*" etc. from OStream. We then canBill Wendling2006-12-171-7/+1
| | | | | | | rework the hacks that had us passing OStream in. We pass in std::ostream* instead, check for null, and then dispatch to the correct print() method. llvm-svn: 32636
* Minor clean up.Evan Cheng2006-12-151-2/+3
| | | | llvm-svn: 32593
* Fix a long-standing spiller bug:Evan Cheng2006-12-141-1/+35
| | | | | | | | | | | | | | | | If a spillslot value is available in a register, and there is a noop copy that targets that register, the spiller correctly decide not to invalidate the spillslot register. However, even though the noop copy does not clobbers the value. It does start a new intersecting live range. That means the spillslot register is available for use but should not be reused for a two-address instruction modref operand which would clobber the new live range. When we remove the noop copy, update the available information by clearing the canClobber bit. llvm-svn: 32576
* Move findTiedToSrcOperand to TargetInstrDescriptor.Evan Cheng2006-12-081-2/+2
| | | | llvm-svn: 32366
* Proper fix for PR1037: to determine is a VR is a modref, check 1) whether it isEvan Cheng2006-12-081-2/+4
| | | | | | | tied to another oeprand, 2) whether is is being tied to by another operand. So the destination operand of a two-address MI can be correctly identified. llvm-svn: 32354
* Revision 1.83 causes PR1037.Reid Spencer2006-12-071-2/+1
| | | | | | Reverted. llvm-svn: 32305
* Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, areBill Wendling2006-12-071-3/+3
| | | | | | now cerr, cout, and NullStream resp. llvm-svn: 32298
* MI keeps a ptr of TargetInstrDescriptor, use it.Evan Cheng2006-12-071-2/+3
| | | | llvm-svn: 32296
* getOperandConstraint returns -1 if the operand does have the specific ↵Evan Cheng2006-12-071-1/+1
| | | | | | constraint. This bug was causing excessive spills. llvm-svn: 32295
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-061-6/+6
| | | | | | is 'unsigned'. llvm-svn: 32279
OpenPOWER on IntegriCloud