[PATCH] D111227: [WebAssembly] Implementation of table.grow/size and ref.null intrinsics

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 6 13:42:43 PDT 2021


tlively added a comment.

In D111227#3045279 <https://reviews.llvm.org/D111227#3045279>, @pmatos wrote:

> - As far as I understand intrinsics cannot be polymorphic, therefore `table.grow` and `ref.null` intrinsics come in two versions: one for `externref` and one for `funcref`.

Intrinsics actually can be polymorphic. For an example, see the definition of `int_wasm_sub_sat_signed`, which is polymorphic over all vector types (although not all vector types are actually supported in the backend). I don't know how much work it would be to support that kind of polymorphism for reference types, though.

> - An intrinsic for `ref.null` is required so that we can create a constant to pass to `table.grow` to initialize the new slots on a table but also for other general uses.

Would it be more trouble than it's worth to try to get a constant zero to mean `ref.null`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111227/new/

https://reviews.llvm.org/D111227



More information about the llvm-commits mailing list