diff options
author | Joerg Sonnenberger <joerg@bec.de> | 2014-05-06 20:43:01 +0000 |
---|---|---|
committer | Joerg Sonnenberger <joerg@bec.de> | 2014-05-06 20:43:01 +0000 |
commit | 818e72515891d6621567988cd6c1069189e87598 (patch) | |
tree | e5044a504b93abf6c59b38ac0defdd375afc4300 /llvm/lib | |
parent | bdc969839aa55aec67860165087e1376a89edba2 (diff) | |
download | bcm5719-llvm-818e72515891d6621567988cd6c1069189e87598.tar.gz bcm5719-llvm-818e72515891d6621567988cd6c1069189e87598.zip |
If a function needs a frame pointer, but r11 (aka fp) has not been used,
remove it from the list of unspilled registers. Otherwise the following
attempt to keep the stack aligned by picking an extra GPR register to
spill will not work as it picks up r11.
llvm-svn: 208129
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/ARM/ARMFrameLowering.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp index c9000156960..5a114a94e6f 100644 --- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp +++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp @@ -1529,6 +1529,10 @@ ARMFrameLowering::processFunctionBeforeCalleeSavedScan(MachineFunction &MF, if (hasFP(MF)) { MRI.setPhysRegUsed(FramePtr); + auto FPPos = std::find(UnspilledCS1GPRs.begin(), UnspilledCS1GPRs.end(), + FramePtr); + if (FPPos != UnspilledCS1GPRs.end()) + UnspilledCS1GPRs.erase(FPPos); NumGPRSpills++; } |