File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
llvm/lib/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -3763,18 +3763,16 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
37633763 }
37643764 }
37653765
3766- // Handle the case where a value is multiplied by a power of two.
3767- // For example:
3768- // %2 = insertelement <4 x i32> poison, i32 %0, i64 0
3769- // %3 = shufflevector <4 x i32> %2, poison, <4 x i32> zeroinitializer
3770- // %4 = tail call i32 @llvm.vector.reduce.add.v4i32(%3)
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)
37713770 // =>
37723771 // %2 = shl i32 %0, 2
3773- assert (Arg->getType ()->isVectorTy () &&
3774- " The vector.reduce.add intrinsic's argument must be a vector!" );
3775-
37763772 if (Value *Splat = getSplatValue (Arg)) {
37773773 // It is only a multiplication if we add the same element over and over.
3774+ assert (Arg->getType ()->isVectorTy () &&
3775+ " The vector.reduce.add intrinsic's argument must be a vector!" );
37783776 ElementCount ReducedVectorElementCount =
37793777 static_cast <VectorType *>(Arg->getType ())->getElementCount ();
37803778 if (ReducedVectorElementCount.isFixed ()) {
You can’t perform that action at this time.
0 commit comments