Revert r88830 and r88831 which appear to have caused a selfhost buildbot some
authorNick Lewycky <nicholas@mxc.ca>
Sun, 15 Nov 2009 07:47:32 +0000 (07:47 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sun, 15 Nov 2009 07:47:32 +0000 (07:47 +0000)
grief. I suspect this patch merely exposed a bug else.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88841 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp
test/Transforms/InstCombine/compare-signs.ll

index 14a482dd6e8ad499fde282f79151ea1445740250..efda6608e44d1a67d44ead393a6f611c730ab34e 100644 (file)
@@ -8539,34 +8539,6 @@ Instruction *InstCombiner::transformZExtICmp(ICmpInst *ICI, Instruction &CI,
     }
   }
 
-  // icmp ne A, B is equal to xor A, B when A and B only really have one bit.
-  // It is also profitable to transform icmp eq into not(xor(A, B)) because that
-  // may lead to additional simplifications.
-  if (CI.getType() == ICI->getOperand(0)->getType()) {
-    if (const IntegerType *ITy = dyn_cast<IntegerType>(CI.getType())) {
-      Value *LHS = ICI->getOperand(0);
-      Value *RHS = ICI->getOperand(1);
-
-      uint32_t BitWidth = ITy->getBitWidth();
-      APInt KnownZeroLHS(BitWidth, 0), KnownOneLHS(BitWidth, 0);
-      APInt KnownZeroRHS(BitWidth, 0), KnownOneRHS(BitWidth, 0);
-      APInt TypeMask(APInt::getAllOnesValue(BitWidth));
-      ComputeMaskedBits(LHS, TypeMask, KnownZeroLHS, KnownOneLHS);
-      ComputeMaskedBits(RHS, TypeMask, KnownZeroRHS, KnownOneRHS);
-
-      if (KnownZeroLHS.countLeadingOnes() == BitWidth-1 &&
-          KnownZeroRHS.countLeadingOnes() == BitWidth-1) {
-        if (!DoXform) return ICI;
-
-        Value *Xor = Builder->CreateXor(LHS, RHS);
-        if (ICI->isTrueWhenEqual())
-          Xor = Builder->CreateXor(Xor, ConstantInt::get(ITy, 1));
-        Xor->takeName(ICI);
-        return ReplaceInstUsesWith(CI, Xor);
-      }
-    }
-  }
-
   return 0;
 }
 
index ba638ba36fc0daf0ea542115bc33ac001097a5b2..2f98641a2494edb35ac6b4959f96c5627027aeff 100644 (file)
@@ -1,4 +1,5 @@
 ; RUN: opt %s -instcombine -S | FileCheck %s
+; XFAIL: *
 ; PR5438
 
 ; TODO: This should also optimize down.