[llvm] [VPlan] Compute cost of some VPWidenIntOrFpInductions in VPlan (PR #202232)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 29 03:03:56 PDT 2026


================
@@ -680,49 +680,85 @@ exit:
 define void @wombat(i32 %arg, ptr %dst) #1 {
 ; CHECK-LABEL: define void @wombat(
 ; CHECK-SAME: i32 [[ARG:%.*]], ptr [[DST:%.*]]) #[[ATTR1:[0-9]+]] {
-; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:  [[ENTRY:.*]]:
 ; CHECK-NEXT:    [[MUL:%.*]] = mul i32 [[ARG]], 3
 ; CHECK-NEXT:    [[ZEXT:%.*]] = zext i32 [[ARG]] to i64
-; CHECK-NEXT:    br label %[[VECTOR_PH:.*]]
+; CHECK-NEXT:    br i1 false, label %[[VEC_EPILOG_SCALAR_PH:.*]], label %[[VECTOR_MAIN_LOOP_ENTRY:.*]]
+; CHECK:       [[VECTOR_MAIN_LOOP_ENTRY]]:
+; CHECK-NEXT:    br i1 false, label %[[VEC_EPILOG_PH:.*]], label %[[VECTOR_PH:.*]]
 ; CHECK:       [[VECTOR_PH]]:
-; CHECK-NEXT:    [[TMP0:%.*]] = mul i32 56, [[ARG]]
+; CHECK-NEXT:    [[BROADCAST_SPLATINSERT:%.*]] = insertelement <8 x i32> poison, i32 [[ARG]], i64 0
----------------
fhahn wrote:

Yep, the difference here is that we now more accurately cost what we generate, which does not need the multiply in particular in the loop because it is folded into the start computation and step

https://github.com/llvm/llvm-project/pull/202232


More information about the llvm-commits mailing list