mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 18:34:09 +00:00
Add dynamic realignment when rematerializing the base register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116886 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f6d7df6f21
commit
8b95c3ebfb
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user