[PATCH] D105013: [InstCombine] try to fold the expression "(A & ~B) + B" to "A | B"

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 08:26:41 PDT 2021


spatel added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/and-to-xor.ll:8
+; CHECK: %{{[0-9]+}} = or i32 %{{[0-9]+}}, %{{[0-9]+}}
+define i32 @and_to_xor1(i32 %0, i32 %1) local_unnamed_addr #0 {
+  %3 = shl nsw i32 %0, 1
----------------
1. The tests should be minimized - only instructions in the most basic pattern need to be here, so something like:
https://alive2.llvm.org/ce/z/NrJRbF

2. Use llvm/utils/update_test_checks.py to auto-generate the CHECK lines.

3. You can probably add these tests in the same file where existing haveNoCommonBitSet patterns are tested (disable the existing transform and see which tests fail).


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

https://reviews.llvm.org/D105013



More information about the llvm-commits mailing list