[Mlir-commits] [mlir] [MLIR][Wasm] Introduce the WasmSSA MLIR dialect (PR #149233)

Mehdi Amini llvmlistbot at llvm.org
Thu Jul 24 02:39:57 PDT 2025


================
@@ -0,0 +1,45 @@
+//===- WasmSSAInterfaces.h - WasmSSA Interfaces ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines op interfaces for the WasmSSA dialect in MLIR.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_WasmSSA_IR_WasmSSAINTERFACES_H_
+#define MLIR_DIALECT_WasmSSA_IR_WasmSSAINTERFACES_H_
+
+#include "mlir/IR/BuiltinAttributes.h"
+#include "mlir/IR/OpDefinition.h"
+
+namespace mlir::wasmssa {
+namespace detail {
+LogicalResult verifyConstantExpressionInterface(Operation *op);
+LogicalResult verifyLabelBranchingOpInterface(Operation *op);
+template <typename OpType>
+LogicalResult verifyLabelLevelInterfaceIsTerminator() {
+  static_assert(OpType::template hasTrait<::mlir::OpTrait::IsTerminator>(),
+                "LabelLevelOp should be terminator ops");
+  return success();
+}
+LogicalResult verifyLabelLevelInterface(Operation *op);
+} // namespace detail
+template <class OperationType>
+struct AlwaysValidConstantExprOpTrait
+    : public OpTrait::TraitBase<OperationType, AlwaysValidConstantExprOpTrait> {};
+
+template<typename OpType>
+struct ConstantExpressionInitializerOpTrait : public OpTrait::TraitBase<OpType, ConstantExpressionInitializerOpTrait>{
+    static LogicalResult verifyTrait(Operation* op) {
+        return detail::verifyConstantExpressionInterface(op);
+    }
+};
----------------
joker-eph wrote:

Can you please document all the public APIs and classes?

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


More information about the Mlir-commits mailing list