[llvm] [VPlan] Update scalar induction resume values in VPlan. (PR #110577)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 1 14:06:49 PST 2024


================
@@ -356,9 +356,10 @@ define void @latch_branch_cost(ptr %dst) {
 ; DEFAULT-NEXT:    br i1 false, label [[SCALAR_PH]], label [[VEC_EPILOG_PH]]
 ; DEFAULT:       vec.epilog.ph:
 ; DEFAULT-NEXT:    [[VEC_EPILOG_RESUME_VAL:%.*]] = phi i64 [ 96, [[VEC_EPILOG_ITER_CHECK]] ], [ 0, [[VECTOR_PH]] ]
+; DEFAULT-NEXT:    [[VEC_EPILOG_RESUME_VAL1:%.*]] = phi i64 [ 96, [[VEC_EPILOG_ITER_CHECK]] ], [ 0, [[VECTOR_PH]] ]
----------------
fhahn wrote:

Updated to re-use the canonical IV resume value for the epilogue loop if a suitable phi exists. That helped remove some of the test differences, but many renaming ones still remain.

I don't think we can remove the duplicates here with a VPlan-to-VPlan transform; we need to generate a epilogue resume value in the preheader of the epilogue loop, during creation of the skeleton for the epilogue loop (it may not exist, if there's no induction in the original loop that is canonical)

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


More information about the llvm-commits mailing list