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

Paulo Matos via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 18 00:07:35 PDT 2023


pmatos added a comment.

In D150670#4351147 <https://reviews.llvm.org/D150670#4351147>, @nikic wrote:

> Lowering to a rotate intrinsic only "solves" this for wasm and will at the same time make these rotates completely opaque to optimization -- heck, it looks like we don't even support constant folding for these intrinsics (https://llvm.godbolt.org/z/hMWG16b9W).

Another thing wrt this optimization regard is that Wasm is slightly different from other targets in that it's not natively executed but instead executed through a VM or passed through binaryen for further optimization. I just tested this and emcc which passes the resulting file through binaryen performs this optimization. I imagine V8 won't have problems with this code either, therefore the missing optimization in llvm is not problematic for the target.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150670



More information about the cfe-commits mailing list