Skip to content

Commit d11a108

Browse files
committed
Remove redundant power of 2 case
1 parent a8b32af commit d11a108

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3779,17 +3779,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
37793779
unsigned VectorSize = ReducedVectorElementCount.getFixedValue();
37803780
Type *SplatType = Splat->getType();
37813781
unsigned SplatTypeWidth = SplatType->getIntegerBitWidth();
3782-
Value *Res;
3783-
// Power of two is a special case. We can just use a left shif here.
3784-
if (isPowerOf2_32(VectorSize)) {
3785-
unsigned Pow2 = Log2_32(VectorSize);
3786-
Res = Builder.CreateShl(
3787-
Splat, Constant::getIntegerValue(SplatType,
3788-
APInt(SplatTypeWidth, Pow2)));
3789-
return replaceInstUsesWith(CI, Res);
3790-
}
3791-
// Otherwise just multiply.
3792-
Res = Builder.CreateMul(
3782+
Value *Res = Builder.CreateMul(
37933783
Splat, Constant::getIntegerValue(
37943784
SplatType, APInt(SplatTypeWidth, VectorSize)));
37953785
return replaceInstUsesWith(CI, Res);

0 commit comments

Comments
 (0)