[PATCH] D94717: [LoopNest] Consider loop nest with inner loop guard using outer loop induction variable to be perfect

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 29 12:02:27 PDT 2021


bmahjour added inline comments.


================
Comment at: llvm/lib/Analysis/LoopInfo.cpp:402
+
+  // Check if ExitFromLatchSucc (or empty unique successor blocks following
+  // ExitFromLatchSucc) are equal to GuardOtherSucc. If it is return GuardBI,
----------------
[nit] this comment needs to be reworded to be more clear.


================
Comment at: llvm/lib/Analysis/LoopInfo.cpp:405
+  // otherwise return nullptr.
+  if (&LoopNest::skipEmptyBlockUntil(ExitFromLatchSucc, GuardOtherSucc) ==
+      GuardOtherSucc)
----------------
AFAICS `skipEmptyBlockUntil` doesn't check that the unique successor blocks have unique predecessors. Don't we need to check for that too?


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

https://reviews.llvm.org/D94717



More information about the llvm-commits mailing list