[llvm] [WebAssembly, llvm] Add llvm.wasm.ref.test.func intrinsic (PR #147486)

Hood Chatham via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 22 00:25:14 PDT 2025


================
@@ -118,6 +120,51 @@ static SDValue getTagSymNode(int Tag, SelectionDAG *DAG) {
   return DAG->getTargetExternalSymbol(SymName, PtrVT);
 }
 
+static APInt encodeFunctionSignature(SelectionDAG *DAG, SDLoc &DL,
+                                     SmallVector<MVT, 4> &Params,
+                                     SmallVector<MVT, 1> &Returns) {
+  auto toWasmValType = [&DAG, &DL](MVT VT) {
+    if (VT == MVT::i32) {
+      return wasm::ValType::I32;
+    }
+    if (VT == MVT::i64) {
+      return wasm::ValType::I64;
+    }
+    if (VT == MVT::f32) {
+      return wasm::ValType::F32;
+    }
+    if (VT == MVT::f64) {
+      return wasm::ValType::F64;
+    }
+    DAG->getContext()->diagnose(
+        DiagnosticInfoUnsupported(DAG->getMachineFunction().getFunction(),
----------------
hoodmane wrote:

I will switch it back to a fatal? In the followup PR with the clang builtin I will reject these types in Sema.

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


More information about the llvm-commits mailing list