[InstCombine] Remove dead code from foldICmpShlOne. NFC
authorCraig Topper <craig.topper@sifive.com>
Mon, 16 Jan 2023 02:55:15 +0000 (18:55 -0800)
committerCraig Topper <craig.topper@sifive.com>
Mon, 16 Jan 2023 03:10:17 +0000 (19:10 -0800)
This code handles (icmp eq/ne (1 << Y), C) if C is a power of 2.

This case is also handled by the more general foldICmpShlConstConst
which is called before we reach foldICmpShlOne.

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

index 6571c07..5584332 100644 (file)
@@ -2057,8 +2057,6 @@ static Instruction *foldICmpShlOne(ICmpInst &Cmp, Instruction *Shl,
     // Exclude signed min by subtracting 1 and lower the upper bound to 0.
     if (Pred == ICmpInst::ICMP_SLT && (C-1).sle(0))
       return new ICmpInst(ICmpInst::ICMP_EQ, Y, BitWidthMinusOne);
-  } else if (Cmp.isEquality() && CIsPowerOf2) {
-    return new ICmpInst(Pred, Y, ConstantInt::get(ShiftType, C.logBase2()));
   }
 
   return nullptr;