mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user