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

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 01:49:01 PST 2023


mkazantsev 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(
----------------
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.


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

https://reviews.llvm.org/D136233



More information about the llvm-commits mailing list