[Mlir-commits] [mlir] [MLIR][Wasm] Introduce the WasmSSA MLIR dialect (PR #149233)
Oleksandr Alex Zinenko
llvmlistbot at llvm.org
Fri Jul 18 06:11:23 PDT 2025
================
@@ -0,0 +1,61 @@
+//===- WebAssemblySSAInterfaces.cpp - WebAssemblySSA 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 WebAssemblySSA dialect in MLIR.
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/WebAssemblySSA/IR/WebAssemblySSAInterfaces.h"
+#include "mlir/Dialect/WebAssemblySSA/IR/WebAssemblySSA.h"
+#include "mlir/IR/Operation.h"
+#include "mlir/IR/Visitors.h"
+#include "mlir/Support/LLVM.h"
+
+namespace mlir::wasmssa {
+#include "mlir/Dialect/WebAssemblySSA/IR/WebAssemblySSAInterfaces.cpp.inc"
+
+namespace detail {
+LogicalResult verifyWasmSSALabelBranchingInterface(Operation *op) {
+ auto branchInterface = dyn_cast<WasmSSALabelBranchingInterface>(op);
+ auto res = WasmSSALabelBranchingInterface::getTargetOpFromBlock(
----------------
ftynse wrote:
Nit: here and everywhere. We prefer using `auto` only when the type is obvious from the RHS of the initialization statement (a cast, a constructor or at least something that implies the type by its name) or difficult/impossible to spell (iterators, lambdas). Here, it isn't obvious. Checking the signature, it is a `FailureOr<..>`. This object is implicitly convertible to `LogicalResult` so you won't need the awkward `return success(succeeded` below, but it is hard to see without the type.
https://github.com/llvm/llvm-project/pull/149233
More information about the Mlir-commits
mailing list