[MLIR] Switch the default for usePropertiesForAttributes (NFC)

This is adopting properties as storage for attribute by default.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D158581
This commit is contained in:
Mehdi Amini 2023-08-28 15:49:59 -07:00
parent 196ff0c7dd
commit 863c346209
53 changed files with 23 additions and 43 deletions

View File

@ -8,6 +8,14 @@ specifically, it is a snapshot of the MLIR development at the time of the releas
[TOC]
## LLVM 18
### Properties: beyond attributes
See LLVM 17 notes below. The Dialect option `let usePropertiesForAttributes = 1;` is
now the default. You can set it to 0 to revert to the previous behavior. This will be
removed in LLVM 19.
## LLVM 17
See also the [deprecations and refactoring](https://mlir.llvm.org/deprecation/) doc.

View File

@ -14,6 +14,7 @@
#ifndef MLIR_TUTORIAL_TOY_DIALECT_H_
#define MLIR_TUTORIAL_TOY_DIALECT_H_
#include "mlir/Bytecode/BytecodeOpInterface.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/FunctionInterfaces.h"
#include "mlir/IR/SymbolTable.h"

View File

@ -14,6 +14,7 @@
#ifndef MLIR_TUTORIAL_TOY_DIALECT_H_
#define MLIR_TUTORIAL_TOY_DIALECT_H_
#include "mlir/Bytecode/BytecodeOpInterface.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/FunctionInterfaces.h"
#include "mlir/IR/SymbolTable.h"

View File

@ -14,6 +14,7 @@
#ifndef MLIR_TUTORIAL_TOY_DIALECT_H_
#define MLIR_TUTORIAL_TOY_DIALECT_H_
#include "mlir/Bytecode/BytecodeOpInterface.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/FunctionInterfaces.h"

View File

@ -14,6 +14,7 @@
#ifndef MLIR_TUTORIAL_TOY_DIALECT_H_
#define MLIR_TUTORIAL_TOY_DIALECT_H_
#include "mlir/Bytecode/BytecodeOpInterface.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/FunctionInterfaces.h"

View File

@ -14,6 +14,7 @@
#ifndef MLIR_TUTORIAL_TOY_DIALECT_H_
#define MLIR_TUTORIAL_TOY_DIALECT_H_
#include "mlir/Bytecode/BytecodeOpInterface.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/FunctionInterfaces.h"

View File

@ -14,6 +14,7 @@
#ifndef MLIR_TUTORIAL_TOY_DIALECT_H_
#define MLIR_TUTORIAL_TOY_DIALECT_H_
#include "mlir/Bytecode/BytecodeOpInterface.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/FunctionInterfaces.h"

View File

@ -29,7 +29,6 @@ def AMDGPU_Dialect : Dialect {
"gpu::GPUDialect"
];
let useDefaultAttributePrinterParser = 1;
let usePropertiesForAttributes = 1;
}
//===----------------------------------------------------------------------===//

View File

@ -55,8 +55,6 @@ def AMX_Dialect : Dialect {
For details, see the Intel documentation:
https://software.intel.com/content/www/us/en/develop/articles/intel-sdm.html
}];
let usePropertiesForAttributes = 1;
}
//===----------------------------------------------------------------------===//

View File

@ -23,7 +23,6 @@ def Affine_Dialect : Dialect {
let name = "affine";
let cppNamespace = "::mlir::affine";
let hasConstantMaterializer = 1;
let usePropertiesForAttributes = 1;
let dependentDialects = ["arith::ArithDialect"];
}

View File

@ -24,7 +24,6 @@ def Arith_Dialect : Dialect {
let hasConstantMaterializer = 1;
let useDefaultAttributePrinterParser = 1;
let usePropertiesForAttributes = 1;
}
// The predicate indicates the type of the comparison to perform:

View File

@ -24,8 +24,6 @@ include "mlir/IR/OpBase.td"
def ArmNeon_Dialect : Dialect {
let name = "arm_neon";
let cppNamespace = "::mlir::arm_neon";
let usePropertiesForAttributes = 1;
// Note: this does not need to depend on LLVMDialect as long as functions in
// this dialect (such as canonicalization) do not produce entities belonging

View File

@ -28,7 +28,6 @@ def ArmSVE_Dialect : Dialect {
This dialect contains the definitions necessary to target specific Arm SVE
scalable vector operations.
}];
let usePropertiesForAttributes = 1;
}

View File

@ -29,7 +29,6 @@ def AsyncDialect : Dialect {
}];
let useDefaultTypePrinterParser = 1;
let usePropertiesForAttributes = 1;
let extraClassDeclaration = [{
/// The name of a unit attribute on funcs that are allowed to have a

View File

@ -72,7 +72,6 @@ def Bufferization_Dialect : Dialect {
kEscapeAttrName = "bufferization.escape";
}];
let hasOperationAttrVerify = 1;
let usePropertiesForAttributes = 1;
}
#endif // BUFFERIZATION_BASE

View File

@ -22,7 +22,6 @@ def Complex_Dialect : Dialect {
let dependentDialects = ["arith::ArithDialect"];
let hasConstantMaterializer = 1;
let useDefaultAttributePrinterParser = 1;
let usePropertiesForAttributes = 1;
}
#endif // COMPLEX_BASE

View File

@ -28,8 +28,6 @@ def ControlFlow_Dialect : Dialect {
constructs. These constructs generally represent control flow directly
on SSA blocks of a control flow graph.
}];
let usePropertiesForAttributes = 1;
}
class CF_Op<string mnemonic, list<Trait> traits = []> :

View File

@ -45,7 +45,6 @@ def DLTI_Dialect : Dialect {
}];
let useDefaultAttributePrinterParser = 1;
let usePropertiesForAttributes = 1;
}
def DLTI_DataLayoutEntryAttr : DialectAttr<

View File

@ -31,7 +31,6 @@ def EmitC_Dialect : Dialect {
let hasConstantMaterializer = 1;
let useDefaultTypePrinterParser = 1;
let useDefaultAttributePrinterParser = 1;
let usePropertiesForAttributes = 1;
}
#endif // MLIR_DIALECT_EMITC_IR_EMITCBASE

View File

@ -22,7 +22,6 @@ def Func_Dialect : Dialect {
let name = "func";
let cppNamespace = "::mlir::func";
let hasConstantMaterializer = 1;
let usePropertiesForAttributes = 1;
}
// Base class for Func dialect ops.

View File

@ -57,7 +57,6 @@ def GPU_Dialect : Dialect {
let dependentDialects = ["arith::ArithDialect"];
let useDefaultAttributePrinterParser = 1;
let useDefaultTypePrinterParser = 1;
let usePropertiesForAttributes = 1;
}
//===----------------------------------------------------------------------===//

View File

@ -71,7 +71,6 @@ def IRDL_Dialect : Dialect {
let useDefaultAttributePrinterParser = 1;
let useDefaultTypePrinterParser = 1;
let usePropertiesForAttributes = 1;
let name = "irdl";
let cppNamespace = "::mlir::irdl";

View File

@ -83,7 +83,6 @@ def IndexDialect : Dialect {
let hasConstantMaterializer = 1;
let useDefaultAttributePrinterParser = 1;
let usePropertiesForAttributes = 1;
}
#endif // INDEX_DIALECT

View File

@ -20,7 +20,6 @@ def LLVM_Dialect : Dialect {
let hasRegionArgAttrVerify = 1;
let hasRegionResultAttrVerify = 1;
let hasOperationAttrVerify = 1;
let usePropertiesForAttributes = 1;
let extraClassDeclaration = [{
/// Name of the data layout attributes.

View File

@ -46,7 +46,6 @@ def Linalg_Dialect : Dialect {
let hasCanonicalizer = 1;
let hasOperationAttrVerify = 1;
let hasConstantMaterializer = 1;
let usePropertiesForAttributes = 1;
let extraClassDeclaration = [{
/// Attribute name used to to memoize indexing maps for named ops.
constexpr const static ::llvm::StringLiteral

View File

@ -29,7 +29,6 @@ def MLProgram_Dialect : Dialect {
let useDefaultAttributePrinterParser = 1;
let useDefaultTypePrinterParser = 1;
let usePropertiesForAttributes = 1;
}
#endif // MLPROGRAM_BASE

View File

@ -30,7 +30,6 @@ def Math_Dialect : Dialect {
```
}];
let hasConstantMaterializer = 1;
let usePropertiesForAttributes = 1;
let dependentDialects = [
"::mlir::arith::ArithDialect"
];

View File

@ -21,7 +21,6 @@ def MemRef_Dialect : Dialect {
}];
let dependentDialects = ["arith::ArithDialect"];
let hasConstantMaterializer = 1;
let usePropertiesForAttributes = 1;
}
#endif // MEMREF_BASE

View File

@ -37,7 +37,6 @@ def NVGPU_Dialect : Dialect {
}];
let useDefaultTypePrinterParser = 1;
let usePropertiesForAttributes = 1;
let useDefaultAttributePrinterParser = 1;
let extraClassDeclaration = [{

View File

@ -26,7 +26,6 @@ def OpenACC_Dialect : Dialect {
let useDefaultAttributePrinterParser = 1;
let useDefaultTypePrinterParser = 1;
let usePropertiesForAttributes = 1;
let cppNamespace = "::mlir::acc";
let dependentDialects = ["::mlir::memref::MemRefDialect","::mlir::LLVM::LLVMDialect"];
}

View File

@ -28,7 +28,6 @@ def OpenMP_Dialect : Dialect {
let cppNamespace = "::mlir::omp";
let dependentDialects = ["::mlir::LLVM::LLVMDialect, ::mlir::func::FuncDialect"];
let useDefaultAttributePrinterParser = 1;
let usePropertiesForAttributes = 1;
}
// OmpCommon requires definition of OpenACC_Dialect.

View File

@ -66,7 +66,6 @@ def PDL_Dialect : Dialect {
let cppNamespace = "::mlir::pdl";
let useDefaultTypePrinterParser = 1;
let usePropertiesForAttributes = 1;
let extraClassDeclaration = [{
void registerTypes();
}];

View File

@ -38,7 +38,6 @@ def PDLInterp_Dialect : Dialect {
let name = "pdl_interp";
let cppNamespace = "::mlir::pdl_interp";
let dependentDialects = ["pdl::PDLDialect"];
let usePropertiesForAttributes = 1;
let extraClassDeclaration = [{
/// Returns the name of the function containing the matcher code. This
/// function is called by the interpreter when matching an operation.

View File

@ -20,7 +20,6 @@ def Quantization_Dialect : Dialect {
let cppNamespace = "::mlir::quant";
let useDefaultTypePrinterParser = 1;
let usePropertiesForAttributes = 1;
}
//===----------------------------------------------------------------------===//

View File

@ -26,7 +26,6 @@ def SCF_Dialect : Dialect {
let name = "scf";
let cppNamespace = "::mlir::scf";
let dependentDialects = ["arith::ArithDialect"];
let usePropertiesForAttributes = 1;
}
// Base class for SCF dialect ops.

View File

@ -52,7 +52,6 @@ def SPIRV_Dialect : Dialect {
let hasOperationAttrVerify = 1;
let hasRegionArgAttrVerify = 1;
let hasRegionResultAttrVerify = 1;
let usePropertiesForAttributes = 1;
let extraClassDeclaration = [{
void registerAttributes();

View File

@ -41,7 +41,6 @@ def ShapeDialect : Dialect {
let useDefaultTypePrinterParser = 1;
let hasConstantMaterializer = 1;
let hasOperationAttrVerify = 1;
let usePropertiesForAttributes = 1;
}
class Shape_Type<string name, string typeMnemonic> : TypeDef<ShapeDialect, name> {

View File

@ -85,7 +85,6 @@ def SparseTensor_Dialect : Dialect {
let useDefaultAttributePrinterParser = 1;
let useDefaultTypePrinterParser = 1;
let usePropertiesForAttributes = 1;
}
#endif // SPARSETENSOR_BASE

View File

@ -47,7 +47,6 @@ def Tensor_Dialect : Dialect {
let hasCanonicalizer = 1;
let hasConstantMaterializer = 1;
let usePropertiesForAttributes = 1;
let dependentDialects = [
"affine::AffineDialect",
"arith::ArithDialect",

View File

@ -45,7 +45,6 @@ def Tosa_Dialect : Dialect {
let cppNamespace = "mlir::tosa";
let hasConstantMaterializer = 1;
let useDefaultAttributePrinterParser = 1;
let usePropertiesForAttributes = 1;
}
//===----------------------------------------------------------------------===//

View File

@ -19,8 +19,6 @@ def Transform_Dialect : Dialect {
let cppNamespace = "::mlir::transform";
let hasOperationAttrVerify = 1;
let usePropertiesForAttributes = 1;
let extraClassDeclaration = [{
/// Name of the attribute attachable to the symbol table operation
/// containing named sequences. This is used to trigger verification.

View File

@ -9,6 +9,7 @@
#ifndef MLIR_DIALECT_UB_IR_OPS_H
#define MLIR_DIALECT_UB_IR_OPS_H
#include "mlir/Bytecode/BytecodeOpInterface.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"

View File

@ -29,7 +29,6 @@ def Vector_Dialect : Dialect {
let useDefaultAttributePrinterParser = 1;
let hasConstantMaterializer = 1;
let usePropertiesForAttributes = 1;
let dependentDialects = ["arith::ArithDialect"];
}

View File

@ -24,7 +24,6 @@ include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
def X86Vector_Dialect : Dialect {
let name = "x86vector";
let cppNamespace = "::mlir::x86vector";
let usePropertiesForAttributes = 1;
}
//===----------------------------------------------------------------------===//

View File

@ -23,7 +23,6 @@ def Builtin_Dialect : Dialect {
let cppNamespace = "::mlir";
let useDefaultAttributePrinterParser = 0;
let useDefaultTypePrinterParser = 0;
let usePropertiesForAttributes = 1;
let extraClassDeclaration = [{
private:
// Register the builtin Attributes.

View File

@ -89,7 +89,7 @@ class Dialect {
bit isExtensible = 0;
// Whether inherent Attributes defined in ODS will be stored as Properties.
bit usePropertiesForAttributes = 0;
bit usePropertiesForAttributes = 1;
}
#endif // DIALECTBASE_TD

View File

@ -24,7 +24,6 @@ def Test_Dialect : Dialect {
let useDefaultTypePrinterParser = 0;
let useDefaultAttributePrinterParser = 1;
let isExtensible = 1;
let usePropertiesForAttributes = 1;
let dependentDialects = ["::mlir::DLTIDialect"];
let extraClassDeclaration = [{

View File

@ -4,6 +4,7 @@ include "mlir/IR/OpBase.td"
def Test_Dialect : Dialect {
let name = "test";
let usePropertiesForAttributes = 0;
}
class NS_Op<string mnemonic, list<Trait> traits = []> :

View File

@ -9,6 +9,7 @@ include "mlir/IR/OpBase.td"
def Test_Dialect : Dialect {
let name = "test";
let cppNamespace = "foobar";
let usePropertiesForAttributes = 0;
}
class NS_Op<string mnemonic, list<Trait> traits> :
Op<Test_Dialect, mnemonic, traits>;
@ -176,6 +177,7 @@ def AOp : NS_Op<"a_op", []> {
def Test2_Dialect : Dialect {
let name = "test2";
let cppNamespace = "foobar2";
let usePropertiesForAttributes = 0;
}
def AgetOp : Op<Test2_Dialect, "a_get_op", []> {
let arguments = (ins

View File

@ -12,6 +12,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
def Test_Dialect : Dialect {
let name = "test";
let cppNamespace = "NS";
let usePropertiesForAttributes = 0;
}
class NS_Op<string mnemonic, list<Trait> traits> :
Op<Test_Dialect, mnemonic, traits>;

View File

@ -4,6 +4,7 @@ include "mlir/IR/OpBase.td"
def TestDialect : Dialect {
let name = "test";
let usePropertiesForAttributes = 0;
}
class TestFormat_Op<string fmt, list<Trait> traits = []>
: Op<TestDialect, "format_op", traits> {

View File

@ -5,6 +5,7 @@ include "mlir/Interfaces/InferTypeOpInterface.td"
def Test_Dialect : Dialect {
let name = "test";
let usePropertiesForAttributes = 0;
}
class NS_Op<string mnemonic, list<Trait> traits> :
Op<Test_Dialect, mnemonic, traits>;

View File

@ -9,6 +9,7 @@
#ifndef MLIR_TEST_PYTHON_LIB_PYTHONTESTDIALECT_H
#define MLIR_TEST_PYTHON_LIB_PYTHONTESTDIALECT_H
#include "mlir/Bytecode/BytecodeOpInterface.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/Interfaces/InferTypeOpInterface.h"