Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit a3f3596

Browse files
Roger Ferrer Ibanezarielb1
authored andcommitted
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
1 parent 86cf508 commit a3f3596

File tree

2 files changed

+1059
-0
lines changed

2 files changed

+1059
-0
lines changed

lib/Target/ARM/ARMConstantIslandPass.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,13 @@ bool ARMConstantIslands::undoLRSpillRestore() {
17151715
MI->eraseFromParent();
17161716
MadeChange = true;
17171717
}
1718+
if (MI->getOpcode() == ARM::tPUSH &&
1719+
MI->getOperand(2).getReg() == ARM::LR &&
1720+
MI->getNumExplicitOperands() == 3) {
1721+
// Just remove the push.
1722+
MI->eraseFromParent();
1723+
MadeChange = true;
1724+
}
17181725
}
17191726
return MadeChange;
17201727
}

0 commit comments

Comments
 (0)