[llvm] [VPlan] Make canonical IV part of the region (PR #156262)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 11 10:07:43 PDT 2026
================
@@ -4826,14 +4803,15 @@ class VPlan {
return VPB;
}
- /// Create a new loop region with \p Name and entry and exiting blocks set
- /// to \p Entry and \p Exiting respectively, if set. The returned block is
- /// owned by the VPlan and deleted once the VPlan is destroyed.
- VPRegionBlock *createLoopRegion(const std::string &Name = "",
+ /// Create a new loop region with a canonical IV using \p CanIVTy and DL. Use
+ /// \p Name as the regions name and set entry and exiting blocks to \p Entry
+ /// and \p Exiting respectively, if provided. The returned block is owned by
+ /// the VPlan and deleted once the VPlan is destroyed.
+ VPRegionBlock *createLoopRegion(Type *CanIVTy, DebugLoc DL,
+ const std::string &Name = "",
VPBlockBase *Entry = nullptr,
VPBlockBase *Exiting = nullptr) {
- auto *VPB = Entry ? new VPRegionBlock(Entry, Exiting, Name)
- : new VPRegionBlock(Name);
+ auto *VPB = new VPRegionBlock(CanIVTy, DL, Entry, Exiting, Name);
----------------
ayalz wrote:
Can first change to a single `auto *VPB = new VPRegionBlock(Entry, Exiting, Name);` which accepts null Entry and Exit, removing the constructor of VPRegionBlock that accepts neither Entry nor Exit, before landing the extension that also expects CanIVTy and DL.
https://github.com/llvm/llvm-project/pull/156262
More information about the llvm-commits
mailing list