xref: /llvm-project/mlir/include/mlir/Dialect/MLProgram/IR/MLProgramAttributes.td (revision e1795322844ca45ecbcdca8669929a46c666127e)
1//===- MLProgramAttributed.td - Attr definitions -----------*- tablegen -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef MLPROGRAM_ATTRIBUTES
10#define MLPROGRAM_ATTRIBUTES
11
12include "mlir/IR/AttrTypeBase.td"
13include "mlir/IR/BuiltinAttributeInterfaces.td"
14include "mlir/Dialect/MLProgram/IR/MLProgramBase.td"
15
16// Base class for MLProgram dialect attributes.
17class MLProgram_Attr<string name, list<Trait> traits = []>
18    : AttrDef<MLProgram_Dialect, name, traits> {
19  let mnemonic = ?;
20}
21
22//===----------------------------------------------------------------------===//
23// ExternAttr
24//===----------------------------------------------------------------------===//
25
26def MLProgram_ExternAttr : MLProgram_Attr<"Extern", [TypedAttrInterface]> {
27  let summary = "Value used for a global signalling external resolution";
28  let description = [{
29  When used as the value for a GlobalOp, this indicates that the actual
30  value should be resolved externally in an implementation defined manner.
31  The `sym_name` of the global is the key for locating the value.
32
33  Examples:
34
35  ```mlir
36  extern : tensor<4xi32>
37  ```
38  }];
39
40  let parameters = (ins AttributeSelfTypeParameter<"">:$type);
41  let mnemonic = "extern";
42  let assemblyFormat = "";
43}
44
45#endif // MLPROGRAM_ATTRIBUTES
46