[PATCH] D16915: Fix for bug 26465

Taewook Oh via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 15:26:06 PST 2016


twoh added inline comments.

================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:2214-2215
@@ -2213,11 +2213,4 @@
         break;
       case Instruction::Xor:
-        // For the xor case, we can xor two constants together, eliminating
-        // the explicit xor.
-        if (Constant *BOC = dyn_cast<Constant>(BO->getOperand(1))) {
-          return new ICmpInst(ICI.getPredicate(), BO->getOperand(0),
-                              ConstantExpr::getXor(RHS, BOC));
-        } else if (RHSV == 0) {
-          // Replace ((xor A, B) != 0) with (A != B)
-          return new ICmpInst(ICI.getPredicate(), BO->getOperand(0),
-                              BO->getOperand(1));
+        if (BO->hasOneUse()) {
+          if (Constant *BOC = dyn_cast<Constant>(BO->getOperand(1))) {
----------------
Not at all. I should have checked this as well. 


http://reviews.llvm.org/D16915





More information about the llvm-commits mailing list