mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 13:50:11 +00:00
[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:
parent
196ff0c7dd
commit
863c346209
@ -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.
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -29,7 +29,6 @@ def AMDGPU_Dialect : Dialect {
|
||||
"gpu::GPUDialect"
|
||||
];
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -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"];
|
||||
}
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -72,7 +72,6 @@ def Bufferization_Dialect : Dialect {
|
||||
kEscapeAttrName = "bufferization.escape";
|
||||
}];
|
||||
let hasOperationAttrVerify = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
}
|
||||
|
||||
#endif // BUFFERIZATION_BASE
|
||||
|
@ -22,7 +22,6 @@ def Complex_Dialect : Dialect {
|
||||
let dependentDialects = ["arith::ArithDialect"];
|
||||
let hasConstantMaterializer = 1;
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
}
|
||||
|
||||
#endif // COMPLEX_BASE
|
||||
|
@ -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 = []> :
|
||||
|
@ -45,7 +45,6 @@ def DLTI_Dialect : Dialect {
|
||||
}];
|
||||
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
}
|
||||
|
||||
def DLTI_DataLayoutEntryAttr : DialectAttr<
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -57,7 +57,6 @@ def GPU_Dialect : Dialect {
|
||||
let dependentDialects = ["arith::ArithDialect"];
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
let useDefaultTypePrinterParser = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -71,7 +71,6 @@ def IRDL_Dialect : Dialect {
|
||||
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
let useDefaultTypePrinterParser = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
|
||||
let name = "irdl";
|
||||
let cppNamespace = "::mlir::irdl";
|
||||
|
@ -83,7 +83,6 @@ def IndexDialect : Dialect {
|
||||
|
||||
let hasConstantMaterializer = 1;
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
}
|
||||
|
||||
#endif // INDEX_DIALECT
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -29,7 +29,6 @@ def MLProgram_Dialect : Dialect {
|
||||
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
let useDefaultTypePrinterParser = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
}
|
||||
|
||||
#endif // MLPROGRAM_BASE
|
||||
|
@ -30,7 +30,6 @@ def Math_Dialect : Dialect {
|
||||
```
|
||||
}];
|
||||
let hasConstantMaterializer = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
let dependentDialects = [
|
||||
"::mlir::arith::ArithDialect"
|
||||
];
|
||||
|
@ -21,7 +21,6 @@ def MemRef_Dialect : Dialect {
|
||||
}];
|
||||
let dependentDialects = ["arith::ArithDialect"];
|
||||
let hasConstantMaterializer = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
}
|
||||
|
||||
#endif // MEMREF_BASE
|
||||
|
@ -37,7 +37,6 @@ def NVGPU_Dialect : Dialect {
|
||||
}];
|
||||
|
||||
let useDefaultTypePrinterParser = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
|
@ -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"];
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -66,7 +66,6 @@ def PDL_Dialect : Dialect {
|
||||
let cppNamespace = "::mlir::pdl";
|
||||
|
||||
let useDefaultTypePrinterParser = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
let extraClassDeclaration = [{
|
||||
void registerTypes();
|
||||
}];
|
||||
|
@ -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.
|
||||
|
@ -20,7 +20,6 @@ def Quantization_Dialect : Dialect {
|
||||
let cppNamespace = "::mlir::quant";
|
||||
|
||||
let useDefaultTypePrinterParser = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -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.
|
||||
|
@ -52,7 +52,6 @@ def SPIRV_Dialect : Dialect {
|
||||
let hasOperationAttrVerify = 1;
|
||||
let hasRegionArgAttrVerify = 1;
|
||||
let hasRegionResultAttrVerify = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
void registerAttributes();
|
||||
|
@ -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> {
|
||||
|
@ -85,7 +85,6 @@ def SparseTensor_Dialect : Dialect {
|
||||
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
let useDefaultTypePrinterParser = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
}
|
||||
|
||||
#endif // SPARSETENSOR_BASE
|
||||
|
@ -47,7 +47,6 @@ def Tensor_Dialect : Dialect {
|
||||
|
||||
let hasCanonicalizer = 1;
|
||||
let hasConstantMaterializer = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
let dependentDialects = [
|
||||
"affine::AffineDialect",
|
||||
"arith::ArithDialect",
|
||||
|
@ -45,7 +45,6 @@ def Tosa_Dialect : Dialect {
|
||||
let cppNamespace = "mlir::tosa";
|
||||
let hasConstantMaterializer = 1;
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -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.
|
||||
|
@ -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"
|
||||
|
@ -29,7 +29,6 @@ def Vector_Dialect : Dialect {
|
||||
|
||||
let useDefaultAttributePrinterParser = 1;
|
||||
let hasConstantMaterializer = 1;
|
||||
let usePropertiesForAttributes = 1;
|
||||
let dependentDialects = ["arith::ArithDialect"];
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,6 @@ include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
|
||||
def X86Vector_Dialect : Dialect {
|
||||
let name = "x86vector";
|
||||
let cppNamespace = "::mlir::x86vector";
|
||||
let usePropertiesForAttributes = 1;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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 = [{
|
||||
|
@ -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 = []> :
|
||||
|
@ -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
|
||||
|
@ -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>;
|
||||
|
@ -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> {
|
||||
|
@ -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>;
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user