[PATCH] D50891: [LICM] Hoist guards from non-header blocks

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 30 18:35:31 PDT 2018


mkazantsev added inline comments.


================
Comment at: lib/Analysis/MustExecute.cpp:184
+
+  // Fast path: header is always reached once the loop is entered.
+  if (BB == CurLoop->getHeader())
----------------
fedor.sergeev wrote:
> I'm not sure fast-path is needed here, it will definitely be handled by the code below and will only be
> as slow as initialization of empty Predecessors set.
> 
> And, anyway, comment is taken from somewhere else and is a bit confusing.
> If you decide to leave it then it should say:
> "there are no instructions in this loop before the header."
Set creation is just unneeded overhead. Agreed with the comment, it needs fixed. :)


https://reviews.llvm.org/D50891





More information about the llvm-commits mailing list