Skip to content

Commit b86f985

Browse files
committed
Remove redundant variable and comment
1 parent 78a00dd commit b86f985

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3763,21 +3763,13 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
37633763
}
37643764
}
37653765

3766-
// Handle the case where a splat is summarized. In that case we have a
3767-
// multpilication. For example: %2 = insertelement <4 x i32> poison, i32
3768-
// %0, i64 0 %3 = shufflevector <4 x i32> %2, poison, <4 x i32>
3769-
// zeroinitializer %4 = tail call i32 @llvm.vector.reduce.add.v4i32(%3)
3770-
// =>
3771-
// %2 = mul i32 %0, 4
3766+
// vector.reduce.add.vNiM(splat(%x)) -> mul(%x, N)
37723767
if (Value *Splat = getSplatValue(Arg)) {
3773-
// It is only a multiplication if we add the same element over and over.
37743768
ElementCount ReducedVectorElementCount =
37753769
cast<VectorType>(Arg->getType())->getElementCount();
37763770
if (ReducedVectorElementCount.isFixed()) {
37773771
unsigned VectorSize = ReducedVectorElementCount.getFixedValue();
3778-
Type *SplatType = Splat->getType();
3779-
return BinaryOperator::CreateMul(
3780-
Splat, ConstantInt::get(SplatType, VectorSize));
3772+
return BinaryOperator::CreateMul(Splat, ConstantInt::get(Splat->getType(), VectorSize));
37813773
}
37823774
}
37833775
}

0 commit comments

Comments
 (0)