[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
    
    
  
================
@@ -768,10 +768,18 @@ static std::pair<VPBlockBase *, VPBlockBase *> cloneFrom(VPBlockBase *Entry) {
 
 VPRegionBlock *VPRegionBlock::clone() {
   const auto &[NewEntry, NewExiting] = cloneFrom(getEntry());
-  auto *NewRegion = getPlan()->createVPRegionBlock(NewEntry, NewExiting,
-                                                   getName(), isReplicator());
+  auto *NewRegion =
+      getPlan()->createVPRegionBlock(NewEntry, NewExiting, getName());
   for (VPBlockBase *Block : vp_depth_first_shallow(NewEntry))
     Block->setParent(NewRegion);
+
+  if (CanIVInfo.CanIV) {
+    NewRegion->CanIVInfo.CanIV = new VPRegionValue();
+    NewRegion->CanIVInfo.Ty = CanIVInfo.Ty;
+    NewRegion->CanIVInfo.HasNUW = CanIVInfo.HasNUW;
+    NewRegion->CanIVInfo.DL = CanIVInfo.DL;
----------------
fhahn wrote:
Updated, thanks!
https://github.com/llvm/llvm-project/pull/156262
    
    
More information about the llvm-commits
mailing list