[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


================
@@ -2341,6 +2341,11 @@ void LoopVectorizationCostModel::collectLoopScalars(ElementCount VF) {
   // variable and induction variable update remain scalar.
   for (const auto &Induction : Legal->getInductionVars()) {
     auto *Ind = Induction.first;
+    // Skip Ind if it can be treated as both a fixed order recurrence or
+    // induction.
+    if (Legal->isFixedOrderRecurrence(Ind))
+      continue;
----------------
artagnon wrote:

Hm, shouldn't there be some kind of profitability check to cost inductions that are also fixed-order recurrences, in case the induction is the final thing emitted?

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


More information about the llvm-commits mailing list