summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2002-12-04 19:24:45 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2002-12-04 19:24:45 +0000
commitdbb7b65bf308e7f03da5973139a09b8130c976c0 (patch)
tree8109ac9960a70a066b93b1a1a95637f63b130d87 /llvm/lib/CodeGen
parent81c7a3a84cd1c3d0a37d64f0f9265cd828b3d7f9 (diff)
downloadbcm5719-llvm-dbb7b65bf308e7f03da5973139a09b8130c976c0.tar.gz
bcm5719-llvm-dbb7b65bf308e7f03da5973139a09b8130c976c0.zip
Fun arithmetic with iterators aimed at fixing a bug: inserting instructions
after the *current* instruction while keeping the iterator in the same 'logical' place. llvm-svn: 4923
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/RegAllocSimple.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocSimple.cpp b/llvm/lib/CodeGen/RegAllocSimple.cpp
index 0daab42c3eb..596ade5faca 100644
--- a/llvm/lib/CodeGen/RegAllocSimple.cpp
+++ b/llvm/lib/CodeGen/RegAllocSimple.cpp
@@ -29,7 +29,8 @@ namespace {
unsigned NumBytesAllocated, ByteAlignment;
// Maps SSA Regs => offsets on the stack where these values are stored
- std::map<unsigned, unsigned> RegMap; // FIXME: change name to VirtReg2OffsetMap
+ // FIXME: change name to VirtReg2OffsetMap
+ std::map<unsigned, unsigned> RegMap;
// Maps SSA Regs => physical regs
std::map<unsigned, unsigned> SSA2PhysRegMap;
@@ -235,7 +236,8 @@ bool RegAllocSimple::runOnMachineFunction(MachineFunction &Fn) {
if (op.opIsDef()) {
physReg = getFreeReg(virtualReg);
MachineBasicBlock::iterator J = I;
- I = saveVirtRegToStack(J, virtualReg, physReg);
+ J = saveVirtRegToStack(++J, virtualReg, physReg);
+ I = --J;
} else {
I = moveUseToReg(I, virtualReg, physReg);
}
OpenPOWER on IntegriCloud