[PATCH] D113420: [WebAssembly] Implement table instruction intrinsics and ref.null

Paulo Matos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 6 05:18:47 PST 2021


pmatos added inline comments.


================
Comment at: llvm/test/CodeGen/WebAssembly/funcref-call.ll:7-8
 define void @call_funcref(%funcref %ref) {
-  call addrspace(20) void %ref() 
+  %f = bitcast %funcref %ref to %funcptr
+  call addrspace(20) void %f() 
   ret void
----------------
tlively wrote:
> I'm not sure it should be necessary to modify these tests to use `i8` as the pointee type. Ultimately the pointee type shouldn't really matter at all (except at the point when a funcref is called) and we should be relying entirely on the address space to figure out what Wasm type it should be. In fact, it would be useful to test that multiple pointee types work correctly. That will give us confidence that nothing will break when opaque pointers are enabled.
The reason I changed this for all tests is for consistency with intrinsics tests. Intrinsics tests need to define the `funcref` as `i8` pointers to `addspace(20)`, because the intrinsics validator post parse checks that the type defined in LLVM IR matches the type of the intrinsic. Even though it might not be necessary to change it in this specific testcase, I find that for consistency we should always define the `funcref` type as a `type i8 addspace(20)`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113420



More information about the llvm-commits mailing list