[Mlir-commits] [mlir] [MLIR][Wasm] Introduce the WasmSSA MLIR dialect (PR #149233)
Jacques Pienaar
llvmlistbot at llvm.org
Thu Jul 31 07:26:26 PDT 2025
================
@@ -0,0 +1,69 @@
+//===- WasmSSAInterfaces.cpp - 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.
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/WasmSSA/IR/WasmSSAInterfaces.h"
+#include "mlir/Dialect/WasmSSA/IR/WasmSSA.h"
+#include "mlir/IR/Operation.h"
+#include "mlir/IR/Visitors.h"
+#include "mlir/Support/LLVM.h"
+#include "llvm/Support/LogicalResult.h"
+
+namespace mlir::wasmssa {
+#include "mlir/Dialect/WasmSSA/IR/WasmSSAInterfaces.cpp.inc"
+
+namespace detail {
+LogicalResult verifyLabelBranchingOpInterface(Operation *op) {
+ auto branchInterface = dyn_cast<LabelBranchingOpInterface>(op);
+ llvm::FailureOr<LabelLevelOpInterface> res =
+ LabelBranchingOpInterface::getTargetOpFromBlock(
+ op->getBlock(), branchInterface.getExitLevel());
+ return success(succeeded(res));
----------------
jpienaar wrote:
Just return res? (so you could ever `return LableBranchingOpIn...` ) as the implicit conversion should take care of it.
https://github.com/llvm/llvm-project/pull/149233
More information about the Mlir-commits
mailing list