summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-10-20 00:02:50 +0000
committerJim Grosbach <grosbach@apple.com>2010-10-20 00:02:50 +0000
commitcb6fc2b2dea4887267b9a23fbea834394688e9cd (patch)
treed24e215dabc0264b707fa848c0035a31b16c68b0
parent104a6e9baae960f6b7b32d2b4bdcedec644a3257 (diff)
downloadbcm5719-llvm-cb6fc2b2dea4887267b9a23fbea834394688e9cd.tar.gz
bcm5719-llvm-cb6fc2b2dea4887267b9a23fbea834394688e9cd.zip
Add dynamic realignment when rematerializing the base register.
llvm-svn: 116886
-rw-r--r--llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp b/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
index bbfd627a0cf..39d7afa853d 100644
--- a/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
+++ b/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
@@ -606,6 +606,19 @@ bool ARMExpandPseudo::ExpandMBB(MachineBasicBlock &MBB) {
FramePtr, -NumBytes, ARMCC::AL, 0,
*TII);
}
+ // If there's dynamic realignment, adjust for it.
+ if (!RI.needsStackRealignment(MF)) {
+ MachineFrameInfo *MFI = MF.getFrameInfo();
+ unsigned MaxAlign = MFI->getMaxAlignment();
+ assert (!AFI->isThumb1OnlyFunction());
+ // Emit bic r6, r6, MaxAlign
+ unsigned bicOpc = AFI->isThumbFunction() ?
+ ARM::t2BICri : ARM::BICri;
+ AddDefaultCC(AddDefaultPred(BuildMI(MBB, MBBI, MI.getDebugLoc(),
+ TII->get(bicOpc), ARM::R6)
+ .addReg(ARM::R6, RegState::Kill)
+ .addImm(MaxAlign-1)));
+ }
}
MI.eraseFromParent();
OpenPOWER on IntegriCloud