[PATCH] D107502: [WebAssembly] Legalize vector types by widening

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 4 14:50:35 PDT 2021


tlively created this revision.
tlively added reviewers: aheejin, dschuff.
Herald added subscribers: wingo, ecnelises, sunfish, hiraditya, jgravelle-google, sbc100.
tlively requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The default legalization of unsupported vector types is to promote the integers
in each lane, which leads to extra sign or zero extending and masking when
moving data into and out of vectors. Switch our preferred type legalization from
the default to vector widening, which keeps the data in the low lanes of the
vector rather than in the low bits of each lane. The unused high lanes can be
ignored.

Half-wide vectors are now loaded from memory into the low 64 bits of the v128
rather than spread out among the lanes. As a result, v128.load64_splat is a much
more common operation, so add new patterns to support it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107502

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h
  llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
  llvm/test/CodeGen/WebAssembly/simd-concat.ll
  llvm/test/CodeGen/WebAssembly/simd-extending.ll
  llvm/test/CodeGen/WebAssembly/simd-load-store-alignment.ll
  llvm/test/CodeGen/WebAssembly/simd-nonconst-sext.ll
  llvm/test/CodeGen/WebAssembly/simd-offset.ll
  llvm/test/CodeGen/WebAssembly/simd-scalar-to-vector.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107502.364254.patch
Type: text/x-patch
Size: 31866 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210804/868bd2f2/attachment.bin>


More information about the llvm-commits mailing list