[PATCH] D157290: [InstCombine] Fold (-a >> b) and/or/xor (~a >> b) into (-a and/or/xor ~a) >> b
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 12 13:24:05 PDT 2023
nikic added a comment.
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
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