[PATCH] D118094: [ValueTracking] Checking haveNoCommonBitsSet for (x & y) and ~(x | y)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 3 12:01:32 PST 2022


spatel added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/pr53357.ll:33
+
+; (y & x) + ~(x | y)
+define i32 @src3(i32 %0, i32 %1) {
----------------
This is logically equivalent to the previous test; the difference is purely one of variable names, not code patterns.
But I think we are missing a test for a pattern where the 'and' is RHS (operand 1) of the 'add', so you can probably adjust it to cover that case.

Note that you may need to add extra instructions to force the IR into the form that you are trying to test. Search for "thwart complexity-based canonicalization" in other files in the instcombine test directory for examples.

Please commit/push these tests with baseline CHECK lines as a preliminary commit to this patch, so we can be sure that we are testing the expected patterns.


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

https://reviews.llvm.org/D118094



More information about the llvm-commits mailing list