mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-02 02:22:31 +00:00
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295816 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5edec6931c
commit
296acceca1
@ -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;
|
||||
}
|
||||
|
1052
test/CodeGen/Thumb/remove-unneeded-push-pop.ll
Normal file
1052
test/CodeGen/Thumb/remove-unneeded-push-pop.ll
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user