diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-04-01 05:36:37 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-04-01 05:36:37 +0000 |
| commit | 0427799531af8e5135d394456f8f196a3611326e (patch) | |
| tree | f9898cff816d4307c5b902743b3fdaa9276775fe /llvm/lib/Transforms/Scalar/InstructionCombining.cpp | |
| parent | 9729bdd8e344b19869fa0c93891fa370a084f39f (diff) | |
| download | bcm5719-llvm-0427799531af8e5135d394456f8f196a3611326e.tar.gz bcm5719-llvm-0427799531af8e5135d394456f8f196a3611326e.zip | |
Fix InstCombine/2007-03-31-InfiniteLoop.ll
llvm-svn: 35536
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index e0fdc5fbaea..2735dff48f4 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -4083,8 +4083,10 @@ Instruction *InstCombiner::visitXor(BinaryOperator &I) { else if (Op0 == B) // A^(B^A) == B return ReplaceInstUsesWith(I, A); } else if (match(Op1I, m_And(m_Value(A), m_Value(B))) && Op1I->hasOneUse()){ - if (A == Op0) // A^(A&B) -> A^(B&A) + if (A == Op0) { // A^(A&B) -> A^(B&A) Op1I->swapOperands(); + std::swap(A, B); + } if (B == Op0) { // A^(B&A) -> (B&A)^A I.swapOperands(); // Simplified below. std::swap(Op0, Op1); |

