OSDN Git Service

[InstCombine] Remove unreachable code for turning an And where all demanded bits...
authorCraig Topper <craig.topper@gmail.com>
Wed, 12 Apr 2017 19:08:03 +0000 (19:08 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 12 Apr 2017 19:08:03 +0000 (19:08 +0000)
We already handled a superset check that included the known ones too and folded to a constant that may include ones. But it can also handle the case of no ones.

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

lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp

index ae214d8..3a5ad34 100644 (file)
@@ -195,10 +195,6 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
         (DemandedMask & ~RHSKnownZero))
       return I->getOperand(1);
 
-    // If all of the demanded bits in the inputs are known zeros, return zero.
-    if ((DemandedMask & (RHSKnownZero|LHSKnownZero)) == DemandedMask)
-      return Constant::getNullValue(VTy);
-
     // If the RHS is a constant, see if we can simplify it.
     if (ShrinkDemandedConstant(I, 1, DemandedMask & ~LHSKnownZero))
       return I;