summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-11-14 22:45:31 +0000
committerTim Northover <tnorthover@apple.com>2014-11-14 22:45:31 +0000
commit9d2d218f49653c4816d5d2671b71b6736b75598f (patch)
tree1cb94b8dc13e7934331fdcdf9a1acc60c0f70f20 /llvm/lib
parenta0691c8983434901710492283d07c37fbcb82019 (diff)
downloadbcm5719-llvm-9d2d218f49653c4816d5d2671b71b6736b75598f.tar.gz
bcm5719-llvm-9d2d218f49653c4816d5d2671b71b6736b75598f.zip
ARM: correctly calculate the offset of FP in its push.
When we folded the DPR alignment gap into a push, we weren't noting the extra distance from the beginning of the push to the FP, and so FP ended up pointing at an incorrect offset. The .cfi_def_cfa_offset directives are still wrong in this case, but I think that can be improved by refactoring. llvm-svn: 222056
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMFrameLowering.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
index 6ebc3aa9dac..24098fabadc 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
@@ -282,9 +282,15 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF) const {
// Prolog/epilog inserter assumes we correctly align DPRs on the stack, so our
// .cfi_offset operations will reflect that.
+ unsigned adjustedGPRCS1Size = GPRCS1Size;
if (DPRGapSize) {
assert(DPRGapSize == 4 && "unexpected alignment requirements for DPRs");
- if (!tryFoldSPUpdateIntoPushPop(STI, MF, LastPush, DPRGapSize))
+ if (tryFoldSPUpdateIntoPushPop(STI, MF, LastPush, DPRGapSize)) {
+ if (LastPush == GPRCS1Push) {
+ FramePtrOffsetInPush += DPRGapSize;
+ adjustedGPRCS1Size += DPRGapSize;
+ }
+ } else
emitSPUpdate(isARM, MBB, MBBI, dl, TII, -DPRGapSize,
MachineInstr::FrameSetup);
}
@@ -354,7 +360,6 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF) const {
NumBytes = 0;
}
- unsigned adjustedGPRCS1Size = GPRCS1Size;
if (NumBytes) {
// Adjust SP after all the callee-save spills.
if (tryFoldSPUpdateIntoPushPop(STI, MF, LastPush, NumBytes)) {
OpenPOWER on IntegriCloud