[PATCH] D102300: [LoopInterchange] Check lcssa phis in the inner latch in scenarios of multi-level nested loops

Whitney Tsang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 30 09:44:06 PDT 2021


Whitney added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopInterchange.cpp:1050
+    for (auto *U : PHI.users()) {
+      Instruction *UI = dyn_cast<Instruction>(U);
+      if (InnerLoopLatch == UI->getParent())
----------------
Can user of PHI be not an instruction? If not, change dyn_cast to cast.


================
Comment at: llvm/test/Transforms/LoopInterchange/innermost-latch-uses-values-in-middle-header.ll:16
+; CHECK: Not interchanging loops. Cannot prove legality.
+define void @innermost_latch_uses_values_in_middle_header() {
+entry:
----------------
Is it possible to show the problem with input IR that the innermost and the middle loop is already interchanged?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102300/new/

https://reviews.llvm.org/D102300



More information about the llvm-commits mailing list