[PATCH] D106500: [WebAssembly] Remove clang builtins for extract_lane and replace_lane

Thomas Lively via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 21 14:59:52 PDT 2021


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

These builtins were added to capture the fact that the underlying Wasm
instructions return i32s and implicitly sign or zero extend the extracted lanes
in the case of the i8x16 and i16x8 variants. But we do sufficient optimizations
during code gen that these low-level details do not need to be exposed to users.

This commit replaces the use of the builtins in wasm_simd128.h with normal
target-independent vector code. As a result, we can switch the relevant
intrinsics to use functions rather than macros and can use more user-friendly
return types rather than trying to precisely expose the underlying Wasm types.
Note, however, that the generated LLVM IR is no different after this change.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106500

Files:
  clang/include/clang/Basic/BuiltinsWebAssembly.def
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/Headers/wasm_simd128.h
  clang/test/CodeGen/builtins-wasm.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106500.360612.patch
Type: text/x-patch
Size: 15558 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210721/7ed59f2c/attachment-0001.bin>


More information about the cfe-commits mailing list