[PATCH] D157290: [InstCombine] Fold (-a >> b) and/or/xor (~a >> b) into (-a and/or/xor ~a) >> b

Maksim Kita via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 13 08:41:09 PDT 2023


kitaisreal added a comment.

In D157290#4582498 <https://reviews.llvm.org/D157290#4582498>, @nikic wrote:

> In D157290#4582439 <https://reviews.llvm.org/D157290#4582439>, @kitaisreal wrote:
>
>> In D157290#4582227 <https://reviews.llvm.org/D157290#4582227>, @nikic wrote:
>>
>>> As far as I can tell the `sub 0, x` is irrelevant for the transform. Can you please remove it from the proofs (and tests)?
>>
>> Yes, `sub 0, x` is irrelevant for the transform. I need to use some instruction to transform `x` so that whole expression will not be optimized by other transformations. I updated tests to use `mul`, it seems from other tests `mul` and `div` are usually used for this.
>
> Can't you just make it a separate argument? Like this: https://alive2.llvm.org/ce/z/ptdCGU

Sure, updated implementation, tests and proofs.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157290



More information about the llvm-commits mailing list