From ef45a1fe1b833a50e43616cee4f29a976aba1602 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 2 Aug 2017 21:05:40 +0000 Subject: [PATCH] [InstCombine] Remove unnecessary temporary APInt. NFCI git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309887 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp index 3611b1fc066..d55d74883da 100644 --- a/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp +++ b/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp @@ -527,11 +527,6 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, Known.Zero.lshrInPlace(ShiftAmt); Known.One.lshrInPlace(ShiftAmt); - // Handle the sign bits. - APInt SignMask(APInt::getSignMask(BitWidth)); - // Adjust to where it is now in the mask. - SignMask.lshrInPlace(ShiftAmt); - // If the input sign bit is known to be zero, or if none of the top bits // are demanded, turn this into an unsigned shift right. assert(BitWidth > ShiftAmt && "Shift amount not saturated?"); @@ -541,7 +536,7 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, I->getOperand(1)); LShr->setIsExact(cast(I)->isExact()); return InsertNewInstWith(LShr, *I); - } else if (Known.One.intersects(SignMask)) { // New bits are known one. + } else if (Known.One[BitWidth-ShiftAmt-1]) { // New bits are known one. Known.One |= HighBits; } } -- 2.50.1