forked from OSchip/llvm-project
[ARM] Fix constant islands pass.
The pass tries to fix a spill of LR that turns out to be unnecessary. So it removes the tPOP but forgets to remove tPUSH. This causes the stack be misaligned upon returning the function. Thus, remove the tPUSH as well in this case. Differential Revision: https://reviews.llvm.org/D30207 llvm-svn: 295816
This commit is contained in:
parent
48e9af6ee8
commit
56db97d4de
|
@ -1741,6 +1741,13 @@ bool ARMConstantIslands::undoLRSpillRestore() {
|
|||
MI->eraseFromParent();
|
||||
MadeChange = true;
|
||||
}
|
||||
if (MI->getOpcode() == ARM::tPUSH &&
|
||||
MI->getOperand(2).getReg() == ARM::LR &&
|
||||
MI->getNumExplicitOperands() == 3) {
|
||||
// Just remove the push.
|
||||
MI->eraseFromParent();
|
||||
MadeChange = true;
|
||||
}
|
||||
}
|
||||
return MadeChange;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue