[PATCH] D157755: [InstSimplify] Use knownbits for simplifying `(icmp ugt/ule (or X, Y), X)`; PR64610

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 12 12:53:55 PDT 2023


nikic added a comment.

I just had the thought that a better way to handle this would be to fold ugt to ne and ule to eq. In fact, this is what D144610 <https://reviews.llvm.org/D144610> does. I think that would fix the motivating case as well?



================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:3135
+      // fold those cases.
+      // NB: Y.One & RHS.Zero is equivilent of ~Y & RHS != 0.
+      else if ((YKnown.One & RHSKnown.Zero) != 0) {
----------------
equivalent


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157755



More information about the llvm-commits mailing list