[PATCH] D64974: [MustExec][LICM] Refactor the first iteration condition check

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 25 11:21:17 PDT 2020


reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.

LGTM w/required changes before commit.



================
Comment at: llvm/lib/Analysis/MustExecute.cpp:123
+      //       solution once the user is gone.
+      if (L && PHI->getParent() == L->getHeader() && L->getLoopPredecessor())
+        return PHI->getIncomingValueForBlock(L->getLoopPredecessor());
----------------
All callers pass L.  Simplify.


================
Comment at: llvm/lib/Analysis/MustExecute.cpp:126
+      const Loop *PL = LI ? LI->getLoopFor(PHI->getParent()) : nullptr;
+      if (PL && PL->getHeader() == PHI->getParent() && PL->getLoopPredecessor())
+        return PHI->getIncomingValueForBlock(PL->getLoopPredecessor());
----------------
The LI but no L path is utterly untested in this patch.  Remove.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64974





More information about the llvm-commits mailing list