diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Support/ConstantRange.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyIndVar.cpp | 2 | 
4 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index af5051650ee..1d5e5fb7195 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -758,7 +758,7 @@ static const SCEV *BinomialCoefficient(const SCEV *It, unsigned K,    unsigned CalculationBits = W + T;    // Calculate 2^T, at width T+W. -  APInt DivFactor = APInt(CalculationBits, 1).shl(T); +  APInt DivFactor = APInt::getOneBitSet(CalculationBits, T);    // Calculate the multiplicative inverse of K! / 2^T;    // this multiplication factor will perform the exact division by @@ -3789,7 +3789,7 @@ const SCEV *ScalarEvolution::createSCEV(Value *V) {          break;        Constant *X = ConstantInt::get(getContext(), -        APInt(BitWidth, 1).shl(SA->getZExtValue())); +        APInt::getOneBitSet(BitWidth, SA->getZExtValue()));        return getMulExpr(getSCEV(U->getOperand(0)), getSCEV(X));      }      break; @@ -3807,7 +3807,7 @@ const SCEV *ScalarEvolution::createSCEV(Value *V) {          break;        Constant *X = ConstantInt::get(getContext(), -        APInt(BitWidth, 1).shl(SA->getZExtValue())); +        APInt::getOneBitSet(BitWidth, SA->getZExtValue()));        return getUDivExpr(getSCEV(U->getOperand(0)), getSCEV(X));      }      break; diff --git a/llvm/lib/Support/ConstantRange.cpp b/llvm/lib/Support/ConstantRange.cpp index d770381dcd5..bb38cd15e63 100644 --- a/llvm/lib/Support/ConstantRange.cpp +++ b/llvm/lib/Support/ConstantRange.cpp @@ -433,7 +433,7 @@ ConstantRange ConstantRange::zeroExtend(uint32_t DstTySize) const {      APInt LowerExt(DstTySize, 0);      if (!Upper) // special case: [X, 0) -- not really wrapping around        LowerExt = Lower.zext(DstTySize); -    return ConstantRange(LowerExt, APInt(DstTySize, 1).shl(SrcTySize)); +    return ConstantRange(LowerExt, APInt::getOneBitSet(DstTySize, SrcTySize));    }    return ConstantRange(Lower.zext(DstTySize), Upper.zext(DstTySize)); diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp index ac7eac94c9d..03fd35fb817 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp @@ -876,7 +876,7 @@ static inline Value *dyn_castFoldableMul(Value *V, ConstantInt *&CST) {        uint32_t BitWidth = cast<IntegerType>(V->getType())->getBitWidth();        uint32_t CSTVal = CST->getLimitedValue(BitWidth);        CST = ConstantInt::get(V->getType()->getContext(), -                             APInt(BitWidth, 1).shl(CSTVal)); +                             APInt::getOneBitSet(BitWidth, CSTVal));        return I->getOperand(0);      }    return 0; diff --git a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp index 41c207c3d5c..bf3442aeaaa 100644 --- a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp @@ -119,7 +119,7 @@ Value *SimplifyIndvar::foldIVUser(Instruction *UseInst, Instruction *IVOperand)          return 0;        D = ConstantInt::get(UseInst->getContext(), -                           APInt(BitWidth, 1).shl(D->getZExtValue())); +                           APInt::getOneBitSet(BitWidth, D->getZExtValue()));      }      FoldedExpr = SE->getUDivExpr(SE->getSCEV(IVSrc), SE->getSCEV(D));    }  | 

