[PATCH] D127206: [LoongArch] Perform `and` combination with a shifted mask

WÁNG Xuěruì via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 9 19:41:29 PDT 2022


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

In D127206#3572045 <https://reviews.llvm.org/D127206#3572045>, @SixWeining wrote:

> In D127206#3569149 <https://reviews.llvm.org/D127206#3569149>, @xen0n wrote:
>
>> It seems only the `(x >> shamt) & mask` case is handled, but not `(x & in_place_mask) >> shamt`; is this an intentional simplification? The current behavior is good though.
>
> Thanks for reminding me. `(x & in_place_mask) >> shamt` is not handled in this patch and it indeed can be optimized to `bstrpick` too. But this is for `shl` combination but not for `and`. Please let me handle it in another patch. Thanks again!

Okay. Immediates in this case need some deeper inspection for confirming it's a single chunk of 1's among 0's, so it's better to split commits.

Then this looks good to me!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127206



More information about the llvm-commits mailing list