[all-commits] [llvm/llvm-project] 8e3e56: [WebAssembly] Add wasm-specific vector shuffle bui...

Thomas Lively via All-commits all-commits at lists.llvm.org
Mon May 11 10:02:18 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8e3e56f2a36701480eeb65e426701d5a9025cc59
      https://github.com/llvm/llvm-project/commit/8e3e56f2a36701480eeb65e426701d5a9025cc59
  Author: Thomas Lively <tlively at google.com>
  Date:   2020-05-11 (Mon, 11 May 2020)

  Changed paths:
    M clang/include/clang/Basic/BuiltinsWebAssembly.def
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/Headers/wasm_simd128.h
    M clang/test/CodeGen/builtins-wasm.c
    M llvm/include/llvm/IR/IntrinsicsWebAssembly.td
    M llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
    M llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll

  Log Message:
  -----------
  [WebAssembly] Add wasm-specific vector shuffle builtin and intrinsic

Summary:

Although using `__builtin_shufflevector` and the `shufflevector`
instruction works fine, they are not opaque to the optimizer. As a
result, DAGCombine can potentially reduce the number of shuffles and
change the shuffle masks. This is unexpected behavior for users of the
WebAssembly SIMD intrinsics who have crafted their shuffles to
optimize the code generated by engines. This patch solves the problem
by adding a new shuffle intrinsic that is opaque to the optimizers in
line with the decision of the WebAssembly SIMD contributors at
https://github.com/WebAssembly/simd/issues/196#issuecomment-622494748. In
the future we may implement custom DAG combines to properly optimize
shuffles and replace this solution.

Reviewers: aheejin, dschuff

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

Tags: #clang, #llvm

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




More information about the All-commits mailing list