[llvm] [VPlan] Chose between FOR and predicated IV in createHeaderPhiRecipes. (PR #201208)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 03:11:59 PDT 2026


================
@@ -709,7 +709,8 @@ void LoopVectorizationLegality::addInductionPhi(PHINode *Phi,
     // one if there are multiple (no good reason for doing this other
     // than it is expedient). We've checked that it begins at zero and
     // steps by one, so this is a canonical induction variable.
-    if (!PrimaryInduction || PhiTy == WidestIndTy)
+    if (!PrimaryInduction ||
+        (PhiTy == WidestIndTy && !FixedOrderRecurrences.contains(Phi)))
----------------
artagnon wrote:

Hm, again: what if the induction-or-FOR turns out to be an induction?

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


More information about the llvm-commits mailing list