[PATCH] D130080: [InstCombine] Change order of canonicalization of ADD and AND

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 07:24:56 PDT 2022


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

LGTM - see inline for one more test upate.

The question of other logic + math combos came up in the previous review. It looks like we don't handle those either way:
https://github.com/llvm/llvm-project/issues/56731

So this patch should be generalized as a next step (although I have no idea if that would uncover other problems).



================
Comment at: llvm/test/Transforms/InstCombine/add.ll:771
   %r = add i8 %and, 96  ; 0x60
   call void @use(i8 %x) ; extra use
   ret i8 %r
----------------
This is an existing issue, but this test doesn't add any value as-is. We should be testing if %and has an extra use, not %x.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130080



More information about the llvm-commits mailing list