Skip to content

Commit c7cae0e

Browse files
committed
[mlir][Attributes][NFC] Move all builtin Attribute classes to BuiltinAttributes.h
This mirrors the file structure of Types. Differential Revision: https://reviews.llvm.org/D92499
1 parent 09f7a55 commit c7cae0e

27 files changed

+3209
-3151
lines changed

flang/include/flang/Optimizer/Dialect/FIRType.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef OPTIMIZER_DIALECT_FIRTYPE_H
1010
#define OPTIMIZER_DIALECT_FIRTYPE_H
1111

12-
#include "mlir/IR/Attributes.h"
13-
#include "mlir/IR/Types.h"
12+
#include "mlir/IR/BuiltinAttributes.h"
13+
#include "mlir/IR/BuiltinTypes.h"
1414
#include "llvm/ADT/SmallVector.h"
1515

1616
namespace llvm {

mlir/docs/CAPI.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,12 @@ for (iter = mlirXGetFirst<Y>(x); !mlirYIsNull(iter);
185185

186186
### Extensions for Dialect Attributes and Types
187187

188-
Dialect attributes and types can follow the example of standard attributes and
188+
Dialect attributes and types can follow the example of builtin attributes and
189189
types, provided that implementations live in separate directories, i.e.
190190
`include/mlir-c/<...>Dialect/` and `lib/CAPI/<...>Dialect/`. The core APIs
191191
provide implementation-private headers in `include/mlir/CAPI/IR` that allow one
192192
to convert between opaque C structures for core IR components and their C++
193193
counterparts. `wrap` converts a C++ class into a C structure and `unwrap` does
194-
the inverse conversion. Once the C++ object is available, the API
195-
implementation should rely on `isa` to implement `mlirXIsAY` and is expected to
196-
use `cast` inside other API calls.
194+
the inverse conversion. Once the C++ object is available, the API implementation
195+
should rely on `isa` to implement `mlirXIsAY` and is expected to use `cast`
196+
inside other API calls.

mlir/docs/LangRef.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ dialect and not the function argument.
13371337
Attribute values are represented by the following forms:
13381338

13391339
```
1340-
attribute-value ::= attribute-alias | dialect-attribute | standard-attribute
1340+
attribute-value ::= attribute-alias | dialect-attribute | builtin-attribute
13411341
```
13421342

13431343
### Attribute Value Aliases
@@ -1404,14 +1404,14 @@ characters that are not allowed in the lighter syntax, as well as unbalanced
14041404
See [here](Tutorials/DefiningAttributesAndTypes.md) on how to define dialect
14051405
attribute values.
14061406

1407-
### Standard Attribute Values
1407+
### Builtin Attribute Values
14081408

1409-
Standard attributes are a core set of
1409+
Builtin attributes are a core set of
14101410
[dialect attributes](#dialect-attribute-values) that are defined in a builtin
14111411
dialect and thus available to all users of MLIR.
14121412

14131413
```
1414-
standard-attribute ::= affine-map-attribute
1414+
builtin-attribute ::= affine-map-attribute
14151415
| array-attribute
14161416
| bool-attribute
14171417
| dictionary-attribute

mlir/include/mlir-c/StandardAttributes.h renamed to mlir/include/mlir-c/BuiltinAttributes.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- mlir-c/StandardAttributes.h - C API for Std Attributes-----*- C -*-===//
1+
//===-- mlir-c/BuiltinAttributes.h - C API for Builtin Attributes -*- C -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM
44
// Exceptions.
@@ -7,12 +7,12 @@
77
//
88
//===----------------------------------------------------------------------===//
99
//
10-
// This header declares the C interface to MLIR Standard attributes.
10+
// This header declares the C interface to MLIR Builtin attributes.
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#ifndef MLIR_C_STANDARDATTRIBUTES_H
15-
#define MLIR_C_STANDARDATTRIBUTES_H
14+
#ifndef MLIR_C_BUILTINATTRIBUTES_H
15+
#define MLIR_C_BUILTINATTRIBUTES_H
1616

1717
#include "mlir-c/AffineMap.h"
1818
#include "mlir-c/IR.h"
@@ -45,9 +45,8 @@ MLIR_CAPI_EXPORTED bool mlirAttributeIsAArray(MlirAttribute attr);
4545

4646
/** Creates an array element containing the given list of elements in the given
4747
* context. */
48-
MLIR_CAPI_EXPORTED MlirAttribute mlirArrayAttrGet(MlirContext ctx,
49-
intptr_t numElements,
50-
MlirAttribute const *elements);
48+
MLIR_CAPI_EXPORTED MlirAttribute mlirArrayAttrGet(
49+
MlirContext ctx, intptr_t numElements, MlirAttribute const *elements);
5150

5251
/// Returns the number of elements stored in the given array attribute.
5352
MLIR_CAPI_EXPORTED intptr_t mlirArrayAttrGetNumElements(MlirAttribute attr);
@@ -437,4 +436,4 @@ mlirSparseElementsAttrGetValues(MlirAttribute attr);
437436
}
438437
#endif
439438

440-
#endif // MLIR_C_STANDARDATTRIBUTES_H
439+
#endif // MLIR_C_BUILTINATTRIBUTES_H

mlir/include/mlir/Bindings/Python/Attributes.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
#define PYTHON_BINDINGS_ATTRIBUTES
1616

1717
// A mapping between the attribute storage type and the corresponding Python
18-
// type. There is not necessarily a 1-1 match for non-standard attributes.
18+
// type. There is not necessarily a 1-1 match for non-builtin attributes.
1919
class PythonAttr<string c, string p> {
2020
string cppStorageType = c;
2121
string pythonType = p;
2222
}
2323

24-
// Mappings between supported standard attribtues and Python types.
24+
// Mappings between supported builtin attribtues and Python types.
2525
def : PythonAttr<"::mlir::Attribute", "_ir.Attribute">;
2626
def : PythonAttr<"::mlir::BoolAttr", "_ir.BoolAttr">;
2727
def : PythonAttr<"::mlir::IntegerAttr", "_ir.IntegerAttr">;

mlir/include/mlir/Dialect/CommonFolders.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef MLIR_DIALECT_COMMONFOLDERS_H
1616
#define MLIR_DIALECT_COMMONFOLDERS_H
1717

18-
#include "mlir/IR/Attributes.h"
18+
#include "mlir/IR/BuiltinAttributes.h"
1919
#include "mlir/IR/BuiltinTypes.h"
2020
#include "llvm/ADT/ArrayRef.h"
2121
#include "llvm/ADT/STLExtras.h"

mlir/include/mlir/Dialect/GPU/ParallelLoopMapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#ifndef MLIR_DIALECT_GPU_PARALLELLOOPMAPPER_H
1515
#define MLIR_DIALECT_GPU_PARALLELLOOPMAPPER_H
1616

17-
#include "mlir/IR/Attributes.h"
17+
#include "mlir/IR/BuiltinAttributes.h"
1818
#include "mlir/Support/LLVM.h"
1919
#include "llvm/ADT/DenseMap.h"
2020

mlir/include/mlir/Dialect/SPIRV/SPIRVAttributes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define MLIR_DIALECT_SPIRV_SPIRVATTRIBUTES_H
1515

1616
#include "mlir/Dialect/SPIRV/SPIRVTypes.h"
17-
#include "mlir/IR/Attributes.h"
17+
#include "mlir/IR/BuiltinAttributes.h"
1818
#include "mlir/Support/LLVM.h"
1919

2020
// Pull in SPIR-V attribute definitions for target and ABI.

mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define MLIR_DIALECT_UTILS_STRUCTUREDOPSUTILS_H
1919

2020
#include "mlir/IR/AffineMap.h"
21-
#include "mlir/IR/Attributes.h"
21+
#include "mlir/IR/BuiltinAttributes.h"
2222
#include "mlir/Support/LLVM.h"
2323
#include "llvm/ADT/StringRef.h"
2424

0 commit comments

Comments
 (0)