[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:58 PDT 2026


================
@@ -914,6 +914,17 @@ 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()) {
+      if (any_of(R.operands(), match_fn(m_ExtractLastLaneOfLastPart(
+                                   m_Specific(PhiR->getOperand(1))))))
+        return true;
+    }
----------------
artagnon wrote:

```suggestion
  for (auto *EB : Plan.getExitBlocks()) {
    for (VPRecipeBase &R : EB->phis()) {
      if (any_of(R.operands(), match_fn(m_ExtractLastLaneOfLastPart(
                                   m_Specific(PhiR->getOperand(1))))))
        return true;
    }
  }
```

Either drop braces entirely, or have outer braces when there are inner braces?

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


More information about the llvm-commits mailing list