[PATCH] D150670: [WebAssembly] Disable generation of fshl/fshr for rotates

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 06:31:14 PDT 2023


nikic added a comment.

In D150670#4368241 <https://reviews.llvm.org/D150670#4368241>, @pmatos wrote:

> In D150670#4368238 <https://reviews.llvm.org/D150670#4368238>, @pmatos wrote:
>
>> In D150670#4352163 <https://reviews.llvm.org/D150670#4352163>, @nikic wrote:
>>
>>> 1. Say that we prefer preserving rotates over "simplifying" funnel shifts (ending up with the rot2 pattern). Basically by skipping the optimization at https://github.com/llvm/llvm-project/blob/7f54b38e28b3b66195de672848f2b5366d0d51e3/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp#L927-L931 if both fsh operands are the same. Assuming this doesn't cause test regressions, I think this would be acceptable to do. From a backend perspective, even for targets that have a native funnel shift (aarch64, x86), the difference between the rot1/rot2 patterns looks pretty neutral.
>
> OK, I just re-read your comment above and I am starting to assume that what you mean is skipping the optimization for all targets if the funnel shift is a rotate (i.e. same first two operands). Is this correct?

That's right.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150670



More information about the llvm-commits mailing list