aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocLocal.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-03-14 07:19:51 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-03-14 07:19:51 +0000
commit39354c99a158685d8bc91b0836c283e936a29cb2 (patch)
tree93a6d08ece00fce39cf0c9c3d89d47ad2028f5e1 /lib/CodeGen/RegAllocLocal.cpp
parent97836fad2c3d705c90855bf2fbb79696c129a64f (diff)
Change MRegisterInfo::foldMemoryOperand to return the folded
instruction to make the API more flexible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12386 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLocal.cpp')
-rw-r--r--lib/CodeGen/RegAllocLocal.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp
index bd1e090a6f..0b5fdc5fea 100644
--- a/lib/CodeGen/RegAllocLocal.cpp
+++ b/lib/CodeGen/RegAllocLocal.cpp
@@ -487,13 +487,12 @@ MachineInstr *RA::reloadVirtReg(MachineBasicBlock &MBB, MachineInstr *MI,
assignVirtToPhysReg(VirtReg, PhysReg);
} else { // No registers available.
// If we can fold this spill into this instruction, do so now.
- MachineBasicBlock::iterator MII = MI;
- if (RegInfo->foldMemoryOperand(MII, OpNum, FrameIndex)) {
+ if (MachineInstr* FMI = RegInfo->foldMemoryOperand(MI, OpNum, FrameIndex)){
++NumFolded;
// Since we changed the address of MI, make sure to update live variables
// to know that the new instruction has the properties of the old one.
- LV->instructionChanged(MI, MII);
- return MII;
+ LV->instructionChanged(MI, FMI);
+ return MBB.insert(MBB.erase(MI), FMI);
}
// It looks like we can't fold this virtual register load into this