summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2013-02-24 00:27:29 +0000
committerCameron Zwarich <zwarich@apple.com>2013-02-24 00:27:29 +0000
commit6868f386c7711c409b2bedf881efcebc692e88b6 (patch)
treefba998c1735164ed2ea295f17dc91f8dfdfc59be /llvm/lib/CodeGen
parentf05c0cbb2098261cce0ec469486173bc6adee2e1 (diff)
downloadbcm5719-llvm-6868f386c7711c409b2bedf881efcebc692e88b6.tar.gz
bcm5719-llvm-6868f386c7711c409b2bedf881efcebc692e88b6.zip
TwoAddressInstructionPass::tryInstructionTransform() only potentially returns
true when shouldOnlyCommute is false, so we can remove code that checks otherwise. llvm-svn: 175980
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/TwoAddressInstructionPass.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index 34946ec1ce9..fe7a7d7bdab 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -1218,10 +1218,11 @@ tryInstructionTransform(MachineBasicBlock::iterator &mi,
unsigned NewDstIdx = NewMIs[1]->findRegisterDefOperandIdx(regA);
unsigned NewSrcIdx = NewMIs[1]->findRegisterUseOperandIdx(regB);
MachineBasicBlock::iterator NewMI = NewMIs[1];
- bool TransformSuccess =
+ bool TransformResult =
tryInstructionTransform(NewMI, mi, NewSrcIdx, NewDstIdx, Dist, true);
- if (TransformSuccess ||
- NewMIs[1]->getOperand(NewSrcIdx).isKill()) {
+ assert(!TransformResult &&
+ "tryInstructionTransform() should return false.");
+ if (NewMIs[1]->getOperand(NewSrcIdx).isKill()) {
// Success, or at least we made an improvement. Keep the unfolded
// instructions and discard the original.
if (LV) {
@@ -1272,8 +1273,6 @@ tryInstructionTransform(MachineBasicBlock::iterator &mi,
}
mi = NewMIs[1];
- if (TransformSuccess)
- return true;
} else {
// Transforming didn't eliminate the tie and didn't lead to an
// improvement. Clean up the unfolded instructions and keep the
OpenPOWER on IntegriCloud