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

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 10:27:49 PDT 2019


tlively added a comment.

In D68527#1700939 <https://reviews.llvm.org/D68527#1700939>, @aheejin wrote:

> Wouldn't minimizing the number of instruction be the same thing as minimizing the number of bytes, only more inaccurate?


It's true that minimizing instructions approximates minimizing bytes, but it also stands on its own as a reasonable metric. In this case minimizing instructions makes more sense than minimizing bytes.

> 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.


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