[PATCH] D88591: [WebAssembly] Emulate v128.const efficiently

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 10:01:24 PDT 2020


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

v128.const was recently implemented in V8, but until it rolls into Chrome
stable, we can't enable it in the WebAssembly backend without breaking origin
trial users. So far we have been lowering build_vectors that would otherwise
have been lowered to v128.const to splats followed by sequences of replace_lane
instructions to initialize each lane individually. That produces large and
inefficient code, so this patch introduces new logic to lower integer vector
constants to a single i64x2.splat where possible, with at most a single
i64x2.replace_lane following it if necessary.

Adapted from a patch authored by @omnisip.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88591

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
  llvm/test/CodeGen/WebAssembly/simd-build-vector.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88591.295337.patch
Type: text/x-patch
Size: 8909 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200930/b93c7c5a/attachment.bin>


More information about the llvm-commits mailing list