summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/VirtRegRewriter.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-10-29 01:15:40 +0000
committerDale Johannesen <dalej@apple.com>2009-10-29 01:15:40 +0000
commit8829fc3a18787e4d26be6aa04fd7fe63ba1d09de (patch)
treeb284656252e8eab2e55cfbeef7edad5d18c129ec /llvm/lib/CodeGen/VirtRegRewriter.cpp
parent33335b15046b3e658f96e4a69c1326261afdecf5 (diff)
downloadbcm5719-llvm-8829fc3a18787e4d26be6aa04fd7fe63ba1d09de.tar.gz
bcm5719-llvm-8829fc3a18787e4d26be6aa04fd7fe63ba1d09de.zip
When there is a 2-instruction spill sequence, record
the second (store) instruction in SpillSlotToUsesMap consistently. I don't think this matters functionally, but it's cleaner and Evan wants it this way. llvm-svn: 85463
Diffstat (limited to 'llvm/lib/CodeGen/VirtRegRewriter.cpp')
-rw-r--r--llvm/lib/CodeGen/VirtRegRewriter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/VirtRegRewriter.cpp b/llvm/lib/CodeGen/VirtRegRewriter.cpp
index a9ff1ad9aed..fd80f460992 100644
--- a/llvm/lib/CodeGen/VirtRegRewriter.cpp
+++ b/llvm/lib/CodeGen/VirtRegRewriter.cpp
@@ -1432,7 +1432,7 @@ private:
MachineBasicBlock::iterator oldNextMII = next(MII);
TII->storeRegToStackSlot(MBB, next(MII), PhysReg, true, StackSlot, RC);
- MachineInstr *StoreMI = next(MII);
+ MachineInstr *StoreMI = prior(oldNextMII);
VRM.addSpillSlotUse(StackSlot, StoreMI);
DEBUG(errs() << "Store:\t" << *StoreMI);
@@ -1751,8 +1751,9 @@ private:
const TargetRegisterClass *RC = RegInfo->getRegClass(VirtReg);
unsigned Phys = VRM.getPhys(VirtReg);
int StackSlot = VRM.getStackSlot(VirtReg);
+ MachineBasicBlock::iterator oldNextMII = next(MII);
TII->storeRegToStackSlot(MBB, next(MII), Phys, isKill, StackSlot, RC);
- MachineInstr *StoreMI = next(MII);
+ MachineInstr *StoreMI = prior(oldNextMII);
VRM.addSpillSlotUse(StackSlot, StoreMI);
DEBUG(errs() << "Store:\t" << *StoreMI);
VRM.virtFolded(VirtReg, StoreMI, VirtRegMap::isMod);
OpenPOWER on IntegriCloud