[PATCH] D101359: [NARY] Don't optimize min/max if there are side uses (part2)

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 30 03:57:29 PDT 2021


mkazantsev added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/NaryReassociate.cpp:621
+        if (llvm::any_of(LHS->users(), [&](auto *U) {
+              return U != I && !(U->hasOneUser() && *U->users().begin() == I);
+            }))
----------------
mkazantsev wrote:
> Is `U != I` even happens to be false? An instruction can only use itself it it's a Phi, and I believe `I` is not a Phi here.
Ah it's a user of `LHS` and not `I`. Makes sense then.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101359



More information about the llvm-commits mailing list