[WebAssembly] Improve codegen for shuffles with undefined lane indices
authorFanchen Kong <fanchen.kong@intel.com>
Tue, 13 Sep 2022 23:03:18 +0000 (16:03 -0700)
committerThomas Lively <tlively@google.com>
Tue, 13 Sep 2022 23:03:18 +0000 (16:03 -0700)
commit28557e8c9872a31a29cf0aca19e9d036caf7eff4
treec9e42341f96a0f83ad8cb91df45beb91fa5ac40b
parentb340c5ae4221a9752712621cd1df06cbc6dfd50b
[WebAssembly] Improve codegen for shuffles with undefined lane indices

For undefined lane indices, fill the mask with {0..N} instead of zeros to allow
further reduction to word/dword shuffle on the VM.

Reviewed By: tlively, penzn

Differential Revision: https://reviews.llvm.org/D133473
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
llvm/test/CodeGen/WebAssembly/fpclamptosat_vec.ll
llvm/test/CodeGen/WebAssembly/simd-build-vector.ll
llvm/test/CodeGen/WebAssembly/simd-concat.ll
llvm/test/CodeGen/WebAssembly/simd-conversions.ll
llvm/test/CodeGen/WebAssembly/simd-extending.ll
llvm/test/CodeGen/WebAssembly/simd.ll