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

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 6 21:02:44 PST 2022


ChuanqiXu added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/pr53357.ll:33
+
+; (y & x) + ~(x | y)
+define i32 @src3(i32 %0, i32 %1) {
----------------
spatel wrote:
> 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.
Thanks for the guide. I've commit the tests in: https://github.com/llvm/llvm-project/commit/1391f91b1f62b9510e4b71737aac2b45d0c4d6cd


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

https://reviews.llvm.org/D118094



More information about the llvm-commits mailing list