[PATCH] D134436: [WebAssembly] Use intrinsics for table.get/set instructions

Paulo Matos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 06:32:16 PDT 2022


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

Initial table.get/set implementation would match and lower combinations
of GEP+load/store to table.get/set instructions. However, this is error
prone due to potential combinations of GEP+load/store we don't implement,
and load/store optimizations. By changing the code to using intrinsics, we
 avoid both issues and simplify the code.

New builtins implemented:

- @llvm.wasm.table.get.externref
- @llvm.wasm.table.get.funcref
- @llvm.wasm.table.set.externref
- @llvm.wasm.table.set.funcref


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134436

Files:
  llvm/include/llvm/IR/IntrinsicsWebAssembly.td
  llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyInstrTable.td
  llvm/test/CodeGen/WebAssembly/externref-tableget.ll
  llvm/test/CodeGen/WebAssembly/externref-tableset.ll
  llvm/test/CodeGen/WebAssembly/funcref-table_call.ll
  llvm/test/CodeGen/WebAssembly/funcref-tableget.ll
  llvm/test/CodeGen/WebAssembly/funcref-tableset.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134436.462164.patch
Type: text/x-patch
Size: 18952 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220922/c501935b/attachment-0001.bin>


More information about the llvm-commits mailing list