[Mlir-commits] [mlir] [MLIR][WASM] Extending the Wasm binary to WasmSSA dialect importer (PR #154053)
Mehdi Amini
llvmlistbot at llvm.org
Mon Aug 18 02:27:55 PDT 2025
================
@@ -809,6 +948,95 @@ inline parsed_inst_t ExpressionParser::parseSpecificInstruction<
return parseConstInst<double>(builder);
}
+template <typename opcode, typename valueType, unsigned int numOperands>
+inline parsed_inst_t ExpressionParser::buildNumericOp(
+ OpBuilder &builder, std::enable_if_t<std::is_arithmetic_v<valueType>> *) {
+ auto ty = buildLiteralType<valueType>(builder);
+ LLVM_DEBUG(llvm::dbgs() << "*** buildNumericOp: numOperands = " << numOperands
+ << ", type = " << ty << " ***\n");
+ auto tysToPop = SmallVector<Type, numOperands>();
+ tysToPop.resize(numOperands);
+ std::fill(tysToPop.begin(), tysToPop.end(), ty);
+ auto operands = popOperands(tysToPop);
+ if (failed(operands))
+ return failure();
+ auto op = builder.create<opcode>(*currentOpLoc, *operands).getResult();
+ LLVM_DEBUG(llvm::dbgs() << "Built: ");
+ LLVM_DEBUG(op.dump());
----------------
joker-eph wrote:
```suggestion
LDBG() << "Built operation: " << op;
```
https://github.com/llvm/llvm-project/pull/154053
More information about the Mlir-commits
mailing list