diff options
author | Cameron Zwarich <zwarich@apple.com> | 2013-02-24 00:27:29 +0000 |
---|---|---|
committer | Cameron Zwarich <zwarich@apple.com> | 2013-02-24 00:27:29 +0000 |
commit | eb1b7254cf1ce480c423c2ae0ff1b68c6ada6180 (patch) | |
tree | d7ecf0378b9c6ebbe75778f05f2722610d15fc8e /lib | |
parent | c5a6349ae84309534e0ade8c7c7ddada808e7729 (diff) |
TwoAddressInstructionPass::tryInstructionTransform() only potentially returns
true when shouldOnlyCommute is false, so we can remove code that checks
otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175980 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/TwoAddressInstructionPass.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index 34946ec1ce..fe7a7d7bda 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/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 |