[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
Sun Aug 13 00:33:34 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:4477
+                          IC.Builder.CreateAnd(A, IC.Builder.CreateNot(Op1)),
+                          Constant::getNullValue(Op1->getType()));
+  }
----------------
The proofs in the patch description need an update.

Worth noting that there is also a similar fold for the case where X is freely invertible: https://alive2.llvm.org/ce/z/cpPV_W

This case might actually be the more common one, because it covers `(X | C) == X`.


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