[PATCH] D68527: [WebAssembly] v8x16.swizzle and rewrite BUILD_VECTOR lowering

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 13:47:20 PDT 2019


aheejin added a comment.

In D68527#1701774 <https://reviews.llvm.org/D68527#1701774>, @tlively wrote:

> In D68527#1700939 <https://reviews.llvm.org/D68527#1700939>, @aheejin wrote:
>
> > If swizzles are a lot more complicated that `v128.const` in execution, doesn't that mean swizzles will likely to take longer to execute in wasm? Why the opposite?
>
>
> Swizzles lower directly to hardware instructions so they are fast for engines to execute. But doing the same operation without a swizzle instruction would require a long sequence of other wasm instructions and therefore be slow to execute. Because this difference is large for swizzles it is a good idea to prefer to use them when possible.


We are deciding which one among const/swizzle/splat to use based on the number of lanes hit by the instruction. The rest is the number of `replace_lane`s, so I don't think swizzles are more expensive to emulate than others, because after a single const/swizzle/splat, all emulation cost is down to the number of `replace_lane`s...? Anyway, not really related to the CL itself


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68527





More information about the llvm-commits mailing list