[lld] [llvm] [WebAssembly] Add exnref type (PR #93586)

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Tue May 28 11:23:04 PDT 2024


================
@@ -137,6 +137,10 @@ class WebAssemblyFastISel final : public FastISel {
       if (Subtarget->hasReferenceTypes())
         return VT;
       break;
+    case MVT::exnref:
+      if (Subtarget->hasReferenceTypes() && Subtarget->hasExceptionHandling())
----------------
aheejin wrote:

We can assume that if we call this from clang (#91299). It may not be the case if someone manually calls `llc` or `wasm-ld` (in case of LTO). But even in those cases it should error out, so I guess that's a reasonable thing to do. But it's not that we can simply check that in `WebAssemblyTargetMachine` because each bitcode function can have different set of features, which are coalesced in [CoalesceFeaturesAndStripAtomics](https://github.com/llvm/llvm-project/blob/73e22ff3d77db72bb9b6e22342417a5f4fe6afb4/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp#L190-L332). But that is a _pass_ that runs as a part of pass manager pipeline so we can't simply check it with an `if` in `WebAssemblyTargetMachine`, which was the reason I did something like #88916.

https://github.com/llvm/llvm-project/pull/93586


More information about the llvm-commits mailing list