Use APInt::getLowBitsSet instead of APInt::getBitsSet for lower bit mask creation
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 3 Mar 2017 16:56:33 +0000 (16:56 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 3 Mar 2017 16:56:33 +0000 (16:56 +0000)
llvm-svn: 296882

llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp

index e641acb..d8824b4 100644 (file)
@@ -852,7 +852,7 @@ Value *InstCombiner::SimplifyShrShlDemandedBits(Instruction *Shr,
   unsigned ShrAmt = ShrOp1.getZExtValue();
 
   KnownOne.clearAllBits();
-  KnownZero = APInt::getBitsSet(KnownZero.getBitWidth(), 0, ShlAmt-1);
+  KnownZero = APInt::getLowBitsSet(KnownZero.getBitWidth(), ShlAmt - 1);
   KnownZero &= DemandedMask;
 
   APInt BitMask1(APInt::getAllOnesValue(BitWidth));