diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-10-20 00:07:12 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-10-20 00:07:12 +0000 |
commit | add38c12b84a57d282aa624ba764a9a2b3f94c44 (patch) | |
tree | 5323e1790b6d4a68c5ce2c9b55867d3add020561 /llvm/lib/Target/ARM/Thumb1FrameLowering.cpp | |
parent | 88b4fa21c84af63dcc80ed622062a0e22c2af538 (diff) | |
download | bcm5719-llvm-add38c12b84a57d282aa624ba764a9a2b3f94c44.tar.gz bcm5719-llvm-add38c12b84a57d282aa624ba764a9a2b3f94c44.zip |
Revert 142337. Thumb1 still doesn't support dynamic stack realignment. :(
llvm-svn: 142557
Diffstat (limited to 'llvm/lib/Target/ARM/Thumb1FrameLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/Thumb1FrameLowering.cpp | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp b/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp index ad1edc8dd8f..d8481778c0d 100644 --- a/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp +++ b/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp @@ -155,32 +155,10 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF) const { AFI->setGPRCalleeSavedArea2Size(GPRCS2Size); AFI->setDPRCalleeSavedAreaSize(DPRCSSize); - // If we need dynamic stack realignment, do it here. Be paranoid and make - // sure if we also have VLAs, we have a base pointer for frame access. - if (RegInfo->needsStackRealignment(MF)) { - // We cannot use sp as source/dest register here, thus we're emitting the - // following sequence: - // mov r4, sp - // lsrs r4, r4, Log2MaxAlign - // lsls r4, r4, Log2MaxAlign - // mov sp, r4 - unsigned MaxAlign = MFI->getMaxAlignment(); - unsigned Log2MaxAlign = Log2_32(MaxAlign); - AddDefaultPred(BuildMI(MBB, MBBI, dl, TII.get(ARM::tMOVr), ARM::R4) - .addReg(ARM::SP, RegState::Kill)); - AddDefaultPred(AddDefaultT1CC(BuildMI(MBB, MBBI, dl, TII.get(ARM::tLSRri), - ARM::R4)) - .addReg(ARM::R4, RegState::Kill) - .addImm(Log2MaxAlign)); - AddDefaultPred(AddDefaultT1CC(BuildMI(MBB, MBBI, dl, TII.get(ARM::tLSLri), - ARM::R4)) - .addReg(ARM::R4, RegState::Kill) - .addImm(Log2MaxAlign)); - AddDefaultPred(BuildMI(MBB, MBBI, dl, TII.get(ARM::tMOVr), ARM::SP) - .addReg(ARM::R4, RegState::Kill)); - - AFI->setShouldRestoreSPFromFP(true); - } + // Thumb1 does not currently support dynamic stack realignment. Report a + // fatal error rather then silently generate bad code. + if (RegInfo->needsStackRealignment(MF)) + report_fatal_error("Dynamic stack realignment not supported for thumb1."); // If we need a base pointer, set it up here. It's whatever the value // of the stack pointer is at this point. Any variable size objects |