[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:
Roger Ferrer Ibanez 2017-02-22 09:06:21 +00:00
parent 5edec6931c
commit 296acceca1
2 changed files with 1059 additions and 0 deletions

View File

@ -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