[PATCH] D133919: [InstCombine] Fold ((x?1:4)&(y?1:4))==0 to x^y

Marc Auberer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 00:47:33 PDT 2022


marcauberer added a comment.

Will execute clang-format later



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:6478
+    ) && match(Op1, m_Zero())) {
+      if ((*C & *D) == 0)
+        return BinaryOperator::CreateXor(A, B);
----------------
@spatel do you know how to check for shared bits between C and D the best. The current solution does not work.
Besides that, by feeding C and D with m_APInt to the match function, the vector test case does not work properly. We might need to fall back to m_Value, do we?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133919



More information about the llvm-commits mailing list