summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMConstantIslandPass.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-07-08 21:50:04 +0000
committerJim Grosbach <grosbach@apple.com>2011-07-08 21:50:04 +0000
commit25e6d48220330d17875d0ae0ad6a45597d5ac36c (patch)
tree8f7e096da2b668fba274d022dd445c9a79b9e144 /lib/Target/ARM/ARMConstantIslandPass.cpp
parentf29608267baf911ccff7015327839201bd1de529 (diff)
downloadllvm-25e6d48220330d17875d0ae0ad6a45597d5ac36c.tar.gz
llvm-25e6d48220330d17875d0ae0ad6a45597d5ac36c.tar.bz2
llvm-25e6d48220330d17875d0ae0ad6a45597d5ac36c.tar.xz
Make tBX_RET and tBX_RET_vararg predicable.
The normal tBX instruction is predicable, so there's no reason the pseudos for using it as a return shouldn't be. Gives us some nice code-gen improvements as can be seen by the test changes. In particular, several tests now have to disable if-conversion because it works too well and defeats the test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMConstantIslandPass.cpp')
-rw-r--r--lib/Target/ARM/ARMConstantIslandPass.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMConstantIslandPass.cpp b/lib/Target/ARM/ARMConstantIslandPass.cpp
index 309caee42b..f45ebdc535 100644
--- a/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ b/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -1538,7 +1538,10 @@ bool ARMConstantIslands::UndoLRSpillRestore() {
if (MI->getOpcode() == ARM::tPOP_RET &&
MI->getOperand(2).getReg() == ARM::PC &&
MI->getNumExplicitOperands() == 3) {
- BuildMI(MI->getParent(), MI->getDebugLoc(), TII->get(ARM::tBX_RET));
+ // Create the new insn and copy the predicate from the old.
+ BuildMI(MI->getParent(), MI->getDebugLoc(), TII->get(ARM::tBX_RET))
+ .addOperand(MI->getOperand(0))
+ .addOperand(MI->getOperand(1));
MI->eraseFromParent();
MadeChange = true;
}