[llvm] [WebAssembly] TableGen-erate SDNode descriptions (PR #166259)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 01:16:38 PST 2025


================
@@ -1830,11 +1816,8 @@ SDValue WebAssemblyTargetLowering::LowerLoad(SDValue Op,
 
     SDValue Idx = DAG.getTargetConstant(*Local, Base, MVT::i32);
     EVT LocalVT = LN->getValueType(0);
-    SDValue LocalGet = DAG.getNode(WebAssemblyISD::LOCAL_GET, DL, LocalVT,
-                                   {LN->getChain(), Idx});
-    SDValue Result = DAG.getMergeValues({LocalGet, LN->getChain()}, DL);
-    assert(Result->getNumValues() == 2 && "Loads must carry a chain!");
-    return Result;
+    return DAG.getNode(WebAssemblyISD::LOCAL_GET, DL, {LocalVT, MVT::Other},
----------------
s-barannikov wrote:

The original code fails verification enabled by this change.
`LOCAL_GET` is declared with `SDNPHasChain` property, and thus should have both chain operand and chain result. The code on the left creates a node without chain result, which causes a check in `SDNodeInfo::verifyNode()` to fail.


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


More information about the llvm-commits mailing list