[llvm-commits] [llvm] r121346 - /llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Jim Grosbach
grosbach at apple.com
Wed Dec 8 17:22:13 PST 2010
Author: grosbach
Date: Wed Dec 8 19:22:13 2010
New Revision: 121346
URL: http://llvm.org/viewvc/llvm-project?rev=121346&view=rev
Log:
When using multiple instructions to reference a frame index, make sure to
update the opcode when necessary as well as the source register.
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=121346&r1=121345&r2=121346&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Wed Dec 8 19:22:13 2010
@@ -1209,7 +1209,12 @@
emitT2RegPlusImmediate(MBB, II, MI.getDebugLoc(), ScratchReg, FrameReg,
Offset, Pred, PredReg, TII);
}
+ // Update the original instruction to use the scratch register.
MI.getOperand(i).ChangeToRegister(ScratchReg, false, false, true);
+ if (MI.getOpcode() == ARM::t2ADDrSPi)
+ MI.setDesc(TII.get(ARM::t2ADDri));
+ else if (MI.getOpcode() == ARM::t2SUBrSPi)
+ MI.setDesc(TII.get(ARM::t2SUBri));
}
}
More information about the llvm-commits
mailing list