[PATCH] D101359: [NARY] Don't optimize min/max if there are side uses (part2)
Evgeniy via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 30 03:16:43 PDT 2021
ebrevnov added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/NaryReassociate.cpp:617
+ if (LHS->hasOneUser()) {
+ if (LHS->user_back() != I)
+ HasSideUse = true;
----------------
mkazantsev wrote:
> How is this even possible? I could not find explaining comment here, but intuitively `LHS` and `RHS` are expected to be arguments of `I`. If `LHS` has the only user then it must be `I`. no?
>
> Could you please add a method comment about what `I`, `LHS` and `RHS` actually are?
>
Yes, your understanding is correct. LHS & RHS simply left and right operands of I (which is min/max or select). I will updated the code shortly
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