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

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 02:04:04 PDT 2026


================
@@ -897,6 +897,18 @@ static bool tryToSinkOrHoistRecurrenceUsers(VPBasicBlock *HeaderVPBB,
   return true;
 }
 
+/// Returns true if \p PhiR's increment is used in an exit block.
+static bool isUsedInExitBlock(VPlan &Plan, VPPhi *PhiR) {
+  for (auto *EB : Plan.getExitBlocks())
+    for (VPRecipeBase &R : EB->phis())
+      for (VPValue *Op : R.operands()) {
+        if (match(Op,
+                  m_ExtractLastLaneOfLastPart(m_Specific(PhiR->getOperand(1)))))
+          return true;
+      }
----------------
artagnon wrote:

```suggestion
      return any_of(R.operands(), match_fn(
                  m_ExtractLastLaneOfLastPart(m_Specific(PhiR->getOperand(1)))));
```

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


More information about the llvm-commits mailing list