[PATCH] D66983: [WebAssembly] Add wasm-specific vector shuffle builtin and intrinsic

Dan Gohman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 29 18:15:25 PDT 2019


sunfish added a comment.

In D66983#1651977 <https://reviews.llvm.org/D66983#1651977>, @dschuff wrote:

> Oh, interesting I didn't notice that those are implementations of the target-specific intrinsics. I wonder if they do that so they can implement the intrinsics on hardware that doesn't support the corresponding instruction? In a situation other than that I think I'd be surprised if I used a builtin for a particular instruction and got something else.


One of the reasons is a belief that LLVM's optimizations are desirable, and that if there are cases where LLVM's optimizations make code worse, it's a bug in LLVM which should be fixed. Do you have any such cases?

I should say, I myself am sympathetic to the argument that if you write `_mm_shuffle_ps`, you might really want `SHUFPS`, and not `__builtin_shufflevector`, but I'm not aware of any target in LLVM that works this way, which is something to consider.

In fact, the argument that `__mm_shuffle_ps` is SHUFPS seems like it ought to be stronger for x86 than wasm, because x86 has about 100 different shuffle instructions each with their own opinion, while wasm just has one shuffle instruction that just does everything.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66983





More information about the cfe-commits mailing list