[llvm] [LV][EVL] Disable fixed-order recurrence idiom with EVL tail folding. (PR #122458)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 12 04:14:19 PST 2025


================
@@ -1447,9 +1447,11 @@ class LoopVectorizationCostModel {
     // Override forced styles if needed.
     // FIXME: use actual opcode/data type for analysis here.
     // FIXME: Investigate opportunity for fixed vector factor.
-    bool EVLIsLegal = UserIC <= 1 &&
-                      TTI.hasActiveVectorLength(0, nullptr, Align()) &&
-                      !EnableVPlanNativePath;
+    bool EVLIsLegal =
+        UserIC <= 1 && TTI.hasActiveVectorLength(0, nullptr, Align()) &&
+        !EnableVPlanNativePath &&
+        // FIXME: remove this once fixed-ordered recurrence is supported.
+        Legal->getFixedOrderRecurrences().empty();
----------------
lukel97 wrote:

I think it's better to detect it in the cost model rather than `tryAddExplicitVectorLength` since if we need to bail in the latter then we end up giving up on vectorizing the loop entirely

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


More information about the llvm-commits mailing list