[llvm] [LV] Update incoming blocks in VPWidenPHIRecipe in reassociateBlocks (PR #125481)
    Luke Lau via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Feb  3 05:01:04 PST 2025
    
    
  
================
@@ -169,8 +169,19 @@ class VPBlockUtils {
   static void reassociateBlocks(VPBlockBase *Old, VPBlockBase *New) {
     for (auto *Pred : to_vector(Old->getPredecessors()))
       Pred->replaceSuccessor(Old, New);
-    for (auto *Succ : to_vector(Old->getSuccessors()))
+    for (auto *Succ : to_vector(Old->getSuccessors())) {
       Succ->replacePredecessor(Old, New);
+
+      // Replace any references to Old in widened phi incoming blocks.
+      while (auto *Region = dyn_cast<VPRegionBlock>(Succ))
+        Succ = Region->getEntry();
----------------
lukel97 wrote:
Ah that's exactly the method I was looking for, thanks!
https://github.com/llvm/llvm-project/pull/125481
    
    
More information about the llvm-commits
mailing list