[PATCH] D45278: [LoopInterchange] Preserve LoopInfo after interchanging.
    Eli Friedman via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Apr  4 12:52:52 PDT 2018
    
    
  
efriedma added a comment.
Can you add verify-loop-info to all the LoopInterchange tests?
================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:1188
+    OuterLoop->removeBlockFromLoop(OrigInnerPreHeader);
+    LI->changeLoopFor(OrigInnerPreHeader, OuterLoopParent);
+  } else
----------------
changeLoopFor works correctly even if OuterLoopParent is null, so the "if" isn't necessary.
================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:1221
+    if (BB == InnerHeader || BB == InnerLatch)
+      OuterLoop->removeBlockFromLoop(BB);
+    else
----------------
This looks weird; you're removing the block from the outer loop, but it's still in the inner loop?
https://reviews.llvm.org/D45278
    
    
More information about the llvm-commits
mailing list