[PATCH] D144610: [InstCombine] Add transforms for `(icmp upred (or X, Y), X)`

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 02:52:56 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:4458
+      return match(V, m_Not(m_Value())) || match(V, m_ImmConstant());
+    };
+    // icmp (X | Y) eq/ne Y --> (X & ~Y) eq/ne 0 if Y is freely invertible
----------------
You can replace this with `isFreeToInvert(Op1, Op1->hasOneUse())`. This will also handle some additional cases if the operand only has one use.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144610



More information about the llvm-commits mailing list