[PATCH] D95425: Implementation of global.get/set for reftypes in LLVM IR

Paulo Matos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 27 07:41:52 PDT 2021


pmatos added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:1086
+    SDValue TableSet = DAG.getMemIntrinsicNode(
+        WebAssemblyISD::TABLE_SET_FUNCREF, DL, DAG.getVTList(MVT::Other),
+        TableSetOps, MVT::funcref,
----------------
pmatos wrote:
> wingo wrote:
> > Should this be TABLE_SET_FUNCREF and not just TABLE_SET ?  Given that we're producing a DAG node that then needs to be selected, I would think the type-specific stuff could happen in the pattern-matching.
> In this case, I think we cannot generate a `TABLE_SET`. I think the `TABLE_SET` you are referring to is the machine instruction defined in the backend which is not matched from here. From here, you can only match the nodes you create and that's `WebAssemblyISD::TABLE_SET_FUNCREF`. I am still not totally clear why this is, but I never had any luck generating the machine instructions defined in the backend directly from lowering so there might be a way but it's not straightforward. So we generate here the custom machine node we created and then we pattern match that in tablegen to generate the instruction. 
Apologies I misunderstood your comment. We can make the node polymorphic and deal with the types in the Pat Frags. I will do that next.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95425



More information about the llvm-commits mailing list