]> granicus.if.org Git - llvm/commit
[WebAssembly] v8x16.swizzle and rewrite BUILD_VECTOR lowering
authorThomas Lively <tlively@google.com>
Wed, 9 Oct 2019 17:39:19 +0000 (17:39 +0000)
committerThomas Lively <tlively@google.com>
Wed, 9 Oct 2019 17:39:19 +0000 (17:39 +0000)
commit4a07687da6745619246689463350c339c9f9d2c6
tree6d8fbc063694cced7cf671ea13c044517b07620e
parentf62ff89b28d3e92c212909180f1c9f0da8c27611
[WebAssembly] v8x16.swizzle and rewrite BUILD_VECTOR lowering

Summary:
Adds the new v8x16.swizzle SIMD instruction as specified at
https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#swizzling-using-variable-indices.
In addition to adding swizzles as a candidate lowering in
LowerBUILD_VECTOR, also rewrites and simplifies the lowering to
minimize the number of replace_lanes necessary rather than trying to
minimize code size. This leads to more uses of v128.const instead of
splats, which is expected to increase performance.

The new code will be easier to tune once V8 implements all the vector
construction operations, and it will also be easier to add new
candidate instructions in the future if necessary.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68527

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374188 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/WebAssemblyISD.def
lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
test/CodeGen/WebAssembly/simd-build-vector.ll
test/MC/WebAssembly/simd-encodings.s