summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-07-11 16:05:50 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-07-11 16:05:50 +0000
commitfc3ea6f4bcb227bf0b77c560b37210fd86d0cea3 (patch)
treeea6c81c137585709ba62cda622e44f33409c33e1 /llvm/lib/Analysis/ScalarEvolution.cpp
parentce2c84e6709898ecd2836462660fd573d271c255 (diff)
downloadbcm5719-llvm-fc3ea6f4bcb227bf0b77c560b37210fd86d0cea3.tar.gz
bcm5719-llvm-fc3ea6f4bcb227bf0b77c560b37210fd86d0cea3.zip
Don't use a potentially expensive shift if all we want is one set bit.
No functionality change. llvm-svn: 186095
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp6
1 files changed, 3 insertions, 3 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;
OpenPOWER on IntegriCloud