[DAGCombine][InstCombine] Fix inverted if condition in equivalent comments in DAGComb...
authorCraig Topper <craig.topper@gmail.com>
Mon, 3 Apr 2017 19:18:48 +0000 (19:18 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 3 Apr 2017 19:18:48 +0000 (19:18 +0000)
llvm-svn: 299378

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

index 779a0b5..0b4fb90 100644 (file)
@@ -4179,7 +4179,7 @@ SDValue DAGCombiner::visitOR(SDNode *N) {
   if (SDValue ROR = ReassociateOps(ISD::OR, SDLoc(N), N0, N1))
     return ROR;
   // Canonicalize (or (and X, c1), c2) -> (and (or X, c2), c1|c2)
-  // iff (c1 & c2) == 0.
+  // iff (c1 & c2) != 0.
   if (N1C && N0.getOpcode() == ISD::AND && N0.getNode()->hasOneUse() &&
              isa<ConstantSDNode>(N0.getOperand(1))) {
     ConstantSDNode *C1 = cast<ConstantSDNode>(N0.getOperand(1));
index 86a04c8..7982697 100644 (file)
@@ -2123,7 +2123,7 @@ Instruction *InstCombiner::visitOr(BinaryOperator &I) {
   if (ConstantInt *RHS = dyn_cast<ConstantInt>(Op1)) {
     ConstantInt *C1 = nullptr; Value *X = nullptr;
     // (X & C1) | C2 --> (X | C2) & (C1|C2)
-    // iff (C1 & C2) == 0.
+    // iff (C1 & C2) != 0.
     if (match(Op0, m_And(m_Value(X), m_ConstantInt(C1))) &&
         (RHS->getValue() & C1->getValue()) != 0 &&
         Op0->hasOneUse()) {