[llvm] [VPlan] Make canonical IV part of the region (PR #156262)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 21 13:25:43 PDT 2025


================
@@ -4378,14 +4352,10 @@ class VPlan {
   LLVM_DUMP_METHOD void dump() const;
 #endif
 
-  /// Returns the canonical induction recipe of the vector loop.
-  VPCanonicalIVPHIRecipe *getCanonicalIV() {
-    VPBasicBlock *EntryVPBB = getVectorLoopRegion()->getEntryBasicBlock();
-    if (EntryVPBB->empty()) {
-      // VPlan native path.
-      EntryVPBB = cast<VPBasicBlock>(EntryVPBB->getSingleSuccessor());
-    }
-    return cast<VPCanonicalIVPHIRecipe>(&*EntryVPBB->begin());
+  /// Returns the canonical induction VPValue of the vector loop.
+  VPValue *getCanonicalIV() { return getVectorLoopRegion()->getCanonicalIV(); }
+  VPCanonicalIVInfo &getCanonicalIVInfo() {
+    return getVectorLoopRegion()->getCanonicalIVInfo();
----------------
fhahn wrote:

Should be tightned now so the only allowed modification is clearing NUW

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


More information about the llvm-commits mailing list