[PATCH] D136233: [SimpleLoopUnswitch] Inject loop-invariant conditions and unswitch them when it's profitable

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 01:53:23 PST 2023


skatkov added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp:3040
+///   ...
+/// Though they don't immediately exist in the IR, we can still inject them.
+static bool insertCandidatesWithPendingInjections(
----------------
mkazantsev wrote:
> skatkov wrote:
> > What if they exist? do you expect that it is already simplified?
> "might not exist".
> 
> Metadata prevents us from doing this twice, but someone else could insert them by other means. This will be handled by GVN.
It might be present in the original code since the beginning. but ok.


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

https://reviews.llvm.org/D136233



More information about the llvm-commits mailing list