[llvm] [LV] Simplify live-out extraction for first-order recurrence phis when tail folding (PR #176108)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 03:27:36 PDT 2026


================
@@ -8575,7 +8575,8 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
 
   // TODO: We can't call runPass on these transforms yet, due to verifier
   // failures.
-  VPlanTransforms::addExitUsersForFirstOrderRecurrences(*Plan, Range);
+  if (!CM.foldTailByMasking())
+    VPlanTransforms::addExitUsersForFirstOrderRecurrences(*Plan, Range);
----------------
Mel-Chen wrote:

@ayalz @david-arm https://github.com/llvm/llvm-project/pull/192229
A simple, full unification leads to regressions. While these appear fixable, it will take some time to address them. Could we adopt a staged approach, landing the optimization for tail-folding first, and then moving on to the non-tail-folding cases later?

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


More information about the llvm-commits mailing list