Don't use a potentially expensive shift if all we want is one set bit.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186095 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2013-07-11 16:05:50 +00:00
parent 1b3e3eef1f
commit 0a230e0d98
4 changed files with 6 additions and 6 deletions

View File

@@ -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;