[PATCH] D124119: [InstCombine] Combine instructions of type or/and where AND masks can be combined.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 03:24:15 PDT 2022


dmgreen added a comment.

Sounds great, doing this is InstCombine as opposed to DAG. That should make all the costmodelling and whatnot come out better.

Do you have alive proofs for the changes? And it might be a good idea to add a few more tests, for one use cases and negative checks that shouldn't fire. Precommitting the tests is also a good idea.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2837
+  // (A | B) | (C & D)
+  //Value *A, *B, *C, *D;
+  if (match(Op0, m_Or(m_Value(A), m_Value(B))) &&
----------------
Looks like this was unneeded.


================
Comment at: llvm/test/Transforms/InstCombine/and-or.ll:359
+
+define i64 @or_or_or_and_complex(i64 noundef %i) local_unnamed_addr #0 {
+; CHECK-LABEL: @or_or_or_and_complex(
----------------
You can remove local_unnamed_addr #0


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124119



More information about the llvm-commits mailing list