[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
Sun Oct 17 21:54:01 PDT 2021


tlively added a comment.

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

> In D111227#3046551 <https://reviews.llvm.org/D111227#3046551>, @tlively wrote:
>
>> 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.
>
> You mean the polymorphism achieve through `llvm_anyvector_ty`? So I guess the way to go about it would be to try to add a `wasm_anyreftype_ty`... I will take a look.

Yes, exactly. There's also the even more permissive `llvm_any_ty`. It looks like this would involve updating llvm/include/llvm/CodeGen/ValueTypes.td and llvm/include/llvm/Support/MachineValueType.h to add a new `rAny` value type that would be used by tablegen in llvm/utils/TableGen/{CodeGenDAGPatterns,CodeGenTarget,IntrinsicEmitter}.cpp.


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