Minor change, no functionality diff
authorChris Lattner <sabre@nondot.org>
Mon, 10 Mar 2003 19:20:30 +0000 (19:20 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 10 Mar 2003 19:20:30 +0000 (19:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5731 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index 041122401ce3bd9248e24ba48a9e18f33218f241..709c6a91129cf9a38d3d4b0f5c3cf6a981dc4f5b 100644 (file)
@@ -510,11 +510,11 @@ Instruction *InstCombiner::visitXor(BinaryOperator &I) {
     if (Op0I->getOpcode() == Instruction::Or && Op0I->use_size() == 1) {
       if (Op0I->getOperand(0) == Op1)                // (B|A)^B == (A|B)^B
         cast<BinaryOperator>(Op0I)->swapOperands();
-      if (Op0I->getOperand(1) == Op1) {              // (A|B)^B == A & ~B
+      if (Op0I->getOperand(1) == Op1) {              // (A|B)^B == ~B & A
         Value *NotB = BinaryOperator::createNot(Op1, Op1->getName()+".not", &I);
         WorkList.push_back(cast<Instruction>(NotB));
-        return BinaryOperator::create(Instruction::And, Op0I->getOperand(0),
-                                      NotB);
+        return BinaryOperator::create(Instruction::And, NotB,
+                                      Op0I->getOperand(0));
       }
     }