1//===-- OpInterfaces.td ------------------------------------*- tablegen -*-===//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2025 Veridise Inc.
6// SPDX-License-Identifier: Apache-2.0
8//===----------------------------------------------------------------------===//
10#ifndef LLZK_GLOBAL_OP_INTERFACES
11#define LLZK_GLOBAL_OP_INTERFACES
13include "mlir/IR/Interfaces.td"
15def GlobalRefOpInterface : OpInterface<"GlobalRefOpInterface"> {
17 Common interface for operations that read or write from a global.
19 let cppNamespace = "::llzk::global";
22 // Requires implementors to have a '$val' argument.
24 [{Gets the SSA Value that holds the read/write data for the GlobalRefOp.}],
25 "::mlir::Value", "getVal", (ins)>,
26 // Requires implementors to have a '$name_ref' argument.
27 InterfaceMethod<[{Gets the global name attribute from the GlobalRefOp.}],
28 "::mlir::SymbolRefAttr", "getNameRef", (ins)>,
31 let extraClassDeclaration = [{
32 /// Gets the definition for the `global` referenced in this op.
33 ::mlir::FailureOr<SymbolLookupResult<GlobalDefOp>> getGlobalDefOp(::mlir::SymbolTableCollection &tables);
37#endif // LLZK_GLOBAL_OP_INTERFACES