LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
OpInterfaces.td
Go to the documentation of this file.
1//===-- OpInterfaces.td ------------------------------------*- tablegen -*-===//
2//
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
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLZK_GLOBAL_OP_INTERFACES
11#define LLZK_GLOBAL_OP_INTERFACES
12
13include "mlir/IR/Interfaces.td"
14
15def GlobalRefOpInterface : OpInterface<"GlobalRefOpInterface"> {
16 let description = [{
17 Common interface for operations that read or write from a global.
18 }];
19 let cppNamespace = "::llzk::global";
20
21 let methods = [
22 // Requires implementors to have a '$val' argument.
23 InterfaceMethod<
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)>,
29 ];
30
31 let extraClassDeclaration = [{
32 /// Gets the definition for the `global` referenced in this op.
33 ::mlir::FailureOr<SymbolLookupResult<GlobalDefOp>> getGlobalDefOp(::mlir::SymbolTableCollection &tables);
34 }];
35}
36
37#endif // LLZK_GLOBAL_OP_INTERFACES