[PATCH] D66035: [WebAssembly] WIP: Add support for reference types

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 24 14:02:39 PDT 2019


tlively added a comment.

It would be great to see some test .ll files here so we can get a better understanding for what is implemented here. I would also like to see tests of what happens if you try to do a `ptrtoint` or some other illegal operation on a reference type.



================
Comment at: llvm/lib/Target/WebAssembly/WebAssembly.h:88
+  MAX_CUSTOM_ADDRESS = 255,
+  ANYREF_ADDRESS = 256, // Address space for anyref
+};
----------------
I assume other reference types will get their own address spaces so we can differentiate them in IR. Would it then make sense to put the table itself in another address space? We should also think about how best to partition the address space space looking forward to when we will have multiple memories, multiple tables, and multiple function references or reference type imports.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:1101
+      GA->getAddressSpace() != WebAssemblyAS::ANYREF_ADDRESS)
+    fail(DL, DAG, "WebAssembly only expects the 0 or 1 address space");
 
----------------
I think this message needs to be updated for the new AS numbers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66035





More information about the llvm-commits mailing list