[mlir] Flip default value of emitAccessorPrefix to kEmitAccessorPrefix_Prefixed
authorRiver Riddle <riddleriver@gmail.com>
Fri, 2 Sep 2022 02:31:31 +0000 (19:31 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 6 Sep 2022 22:56:57 +0000 (15:56 -0700)
Most dialects have already flipped to prefixed, and the intention to switch
has been telegraphed for a while.

Differential Revision: https://reviews.llvm.org/D133179

44 files changed:
flang/include/flang/Optimizer/CodeGen/CGOps.td
flang/include/flang/Optimizer/Dialect/FIRDialect.td
mlir/docs/DefiningDialects.md
mlir/examples/standalone/include/Standalone/StandaloneDialect.td
mlir/examples/toy/Ch2/include/toy/Ops.td
mlir/examples/toy/Ch3/include/toy/Ops.td
mlir/examples/toy/Ch4/include/toy/Ops.td
mlir/examples/toy/Ch5/include/toy/Ops.td
mlir/examples/toy/Ch6/include/toy/Ops.td
mlir/examples/toy/Ch7/include/toy/Ops.td
mlir/include/mlir/Dialect/AMDGPU/AMDGPU.td
mlir/include/mlir/Dialect/AMX/AMX.td
mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticBase.td
mlir/include/mlir/Dialect/ArmNeon/ArmNeon.td
mlir/include/mlir/Dialect/ArmSVE/ArmSVE.td
mlir/include/mlir/Dialect/Bufferization/IR/BufferizationBase.td
mlir/include/mlir/Dialect/Complex/IR/ComplexBase.td
mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td
mlir/include/mlir/Dialect/DLTI/DLTIBase.td
mlir/include/mlir/Dialect/EmitC/IR/EmitCBase.td
mlir/include/mlir/Dialect/Func/IR/FuncOps.td
mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
mlir/include/mlir/Dialect/MLProgram/IR/MLProgramBase.td
mlir/include/mlir/Dialect/Math/IR/MathBase.td
mlir/include/mlir/Dialect/NVGPU/IR/NVGPU.td
mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
mlir/include/mlir/Dialect/Quant/QuantOpsBase.td
mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
mlir/include/mlir/Dialect/Shape/IR/ShapeBase.td
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorBase.td
mlir/include/mlir/Dialect/Tensor/IR/TensorBase.td
mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td
mlir/include/mlir/Dialect/Transform/IR/TransformDialect.td
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
mlir/include/mlir/Dialect/X86Vector/X86Vector.td
mlir/include/mlir/IR/BuiltinDialect.td
mlir/include/mlir/IR/DialectBase.td
mlir/lib/TableGen/Operator.cpp
mlir/test/lib/Dialect/Test/TestDialect.td
mlir/test/mlir-tblgen/op-attribute.td
mlir/test/mlir-tblgen/op-decl-and-defs.td

index 52966dc..936f5ad 100644 (file)
@@ -20,6 +20,7 @@ include "flang/Optimizer/Dialect/FIRTypes.td"
 def fircg_Dialect : Dialect {
   let name = "fircg";
   let cppNamespace = "::fir::cg";
+  let emitAccessorPrefix = kEmitAccessorPrefix_Raw;
 }
 
 // Base class for FIR CG operations.
index 77d34c1..2be4436 100644 (file)
@@ -24,7 +24,6 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
 def fir_Dialect : Dialect {
   let name = "fir";
   let cppNamespace = "::fir";
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
   let useDefaultTypePrinterParser = 0;
   let useDefaultAttributePrinterParser = 0;
 }
index c043eab..1b5a6fb 100644 (file)
@@ -327,8 +327,8 @@ This field may any of the following values:
 * `kEmitAccessorPrefix_Both`
   - Emit with **and** without prefix.
 
-All new dialects are strongly encouraged to use the `kEmitAccessorPrefix_Prefixed` value, as
-the `Raw` form is deprecated and in the process of being removed.
+All new dialects are strongly encouraged to use the default `kEmitAccessorPrefix_Prefixed`
+value, as the `Raw` form is deprecated and in the process of being removed.
 
 Note: Remove this section when all dialects have been switched to the new accessor form.
 
index f0d10ec..1588601 100644 (file)
@@ -24,8 +24,6 @@ def Standalone_Dialect : Dialect {
         working inside of the LLVM source tree.
     }];
     let cppNamespace = "::mlir::standalone";
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 //===----------------------------------------------------------------------===//
index e3e920e..6462787 100644 (file)
@@ -23,7 +23,6 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
 def Toy_Dialect : Dialect {
   let name = "toy";
   let cppNamespace = "::mlir::toy";
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 // Base class for toy dialect operations. This operation inherits from the base
index 1646bb8..580826b 100644 (file)
@@ -22,7 +22,6 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
 def Toy_Dialect : Dialect {
   let name = "toy";
   let cppNamespace = "::mlir::toy";
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 // Base class for toy dialect operations. This operation inherits from the base
index 672876e..2bdae97 100644 (file)
@@ -25,7 +25,6 @@ include "toy/ShapeInferenceInterface.td"
 def Toy_Dialect : Dialect {
   let name = "toy";
   let cppNamespace = "::mlir::toy";
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 // Base class for toy dialect operations. This operation inherits from the base
index 714ddef..cd51e53 100644 (file)
@@ -25,7 +25,6 @@ include "toy/ShapeInferenceInterface.td"
 def Toy_Dialect : Dialect {
   let name = "toy";
   let cppNamespace = "::mlir::toy";
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 // Base class for toy dialect operations. This operation inherits from the base
index 2e1945e..be432bf 100644 (file)
@@ -25,7 +25,6 @@ include "toy/ShapeInferenceInterface.td"
 def Toy_Dialect : Dialect {
   let name = "toy";
   let cppNamespace = "::mlir::toy";
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 // Base class for toy dialect operations. This operation inherits from the base
index 6b462c5..3ec211a 100644 (file)
@@ -25,7 +25,6 @@ include "toy/ShapeInferenceInterface.td"
 def Toy_Dialect : Dialect {
   let name = "toy";
   let cppNamespace = "::mlir::toy";
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 
   // We set this bit to generate a declaration of the `materializeConstant`
   // method so that we can materialize constants for our toy operations.
index 040af3b..c5d776b 100644 (file)
@@ -23,7 +23,6 @@ def AMDGPU_Dialect : Dialect {
     that will eventually be executed on AMD hardware.
   }];
 
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
   let useDefaultAttributePrinterParser = 1;
 }
 
index eda90d4..f665672 100644 (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 emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 //===----------------------------------------------------------------------===//
index 0c7a832..8e04628 100644 (file)
@@ -24,8 +24,6 @@ def Affine_Dialect : Dialect {
   let cppNamespace = "mlir";
   let hasConstantMaterializer = 1;
   let dependentDialects = ["arith::ArithmeticDialect"];
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 // Base class for Affine dialect ops.
index 38bcbf0..30f47cf 100644 (file)
@@ -23,7 +23,6 @@ def Arithmetic_Dialect : Dialect {
   }];
 
   let hasConstantMaterializer = 1;
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 // The predicate indicates the type of the comparison to perform:
index e0f3358..f3ce22d 100644 (file)
@@ -28,8 +28,6 @@ def ArmNeon_Dialect : Dialect {
   // Note: this does not need to depend on LLVMDialect as long as functions in
   // this dialect (such as canonicalization) do not produce entities belonging
   // to the LLVMDialect (ops or types).
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 //===----------------------------------------------------------------------===//
index da9d165..d3ff058 100644 (file)
@@ -28,8 +28,6 @@ def ArmSVE_Dialect : Dialect {
     This dialect contains the definitions necessary to target specific Arm SVE
     scalable vector operations.
   }];
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 //===----------------------------------------------------------------------===//
index 8ed8d76..09f3e73 100644 (file)
@@ -51,7 +51,6 @@ def Bufferization_Dialect : Dialect {
         kEscapeAttrName = "bufferization.escape";
   }];
   let hasOperationAttrVerify = 1;
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 #endif // BUFFERIZATION_BASE
index 15f131c..e346190 100644 (file)
@@ -21,7 +21,6 @@ def Complex_Dialect : Dialect {
 
   let dependentDialects = ["arith::ArithmeticDialect"];
   let hasConstantMaterializer = 1;
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
   let useDefaultAttributePrinterParser = 1;
 }
 
index baba706..7cb22d8 100644 (file)
@@ -23,7 +23,6 @@ def ControlFlow_Dialect : Dialect {
   let name = "cf";
   let cppNamespace = "::mlir::cf";
   let dependentDialects = ["arith::ArithmeticDialect"];
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
   let description = [{
     This dialect contains low-level, i.e. non-region based, control flow
     constructs. These constructs generally represent control flow directly
index 98fc68f..866cc93 100644 (file)
@@ -37,8 +37,6 @@ def DLTI_Dialect : Dialect {
   }];
 
   let useDefaultAttributePrinterParser = 1;
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 def DLTI_DataLayoutEntryAttr : DialectAttr<
index 3050da0..375dbcb 100644 (file)
@@ -31,8 +31,6 @@ def EmitC_Dialect : Dialect {
   let hasConstantMaterializer = 1;
   let useDefaultTypePrinterParser = 1;
   let useDefaultAttributePrinterParser = 1;
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 #endif // MLIR_DIALECT_EMITC_IR_EMITCBASE
index 925d528..fbae244 100644 (file)
@@ -23,7 +23,6 @@ def Func_Dialect : Dialect {
   let cppNamespace = "::mlir::func";
   let dependentDialects = ["cf::ControlFlowDialect"];
   let hasConstantMaterializer = 1;
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 // Base class for Func dialect ops.
index 0933ad4..683dc82 100644 (file)
@@ -82,8 +82,6 @@ def LLVM_Dialect : Dialect {
     /// of some deeply-nested aggregate types in the program.
     ThreadLocalCache<DenseSet<Type>> compatibleTypes;
   }];
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 //===----------------------------------------------------------------------===//
index fffa67b..861ae0c 100644 (file)
@@ -37,8 +37,6 @@ def NVVM_Dialect : Dialect {
   }];
 
   let useDefaultAttributePrinterParser = 1;
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 //===----------------------------------------------------------------------===//
index 5cd6341..b99d514 100644 (file)
@@ -31,8 +31,6 @@ def ROCDL_Dialect : Dialect {
     /// functions.
     static StringRef getKernelFuncAttrName() { return "rocdl.kernel"; }
   }];
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 //===----------------------------------------------------------------------===//
index dbce6b8..a585059 100644 (file)
@@ -29,7 +29,6 @@ def MLProgram_Dialect : Dialect {
 
   let useDefaultAttributePrinterParser = 1;
   let useDefaultTypePrinterParser = 1;
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 #endif // MLPROGRAM_BASE
index 0e1d194..0189fd5 100644 (file)
@@ -30,6 +30,5 @@ def Math_Dialect : Dialect {
     ```
   }];
   let hasConstantMaterializer = 1;
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 #endif // MATH_BASE
index 3b92f54..8858b6c 100644 (file)
@@ -34,8 +34,6 @@ def NVGPU_Dialect : Dialect {
   }];
 
   let useDefaultTypePrinterParser = 1;
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 /// Device-side synchronization token.
index d38db3d..f6a7c9a 100644 (file)
@@ -48,7 +48,6 @@ def PDLInterp_Dialect : Dialect {
     /// to rewrite the IR after a successful match.
     static StringRef getRewriterModuleName() { return "rewriters"; }
   }];
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 //===----------------------------------------------------------------------===//
index d0f1a95..74d69c0 100644 (file)
@@ -20,8 +20,6 @@ def Quantization_Dialect : Dialect {
   let cppNamespace = "::mlir::quant";
 
   let useDefaultTypePrinterParser = 1;
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 //===----------------------------------------------------------------------===//
index 1cd1cb5..d542093 100644 (file)
@@ -24,7 +24,6 @@ def SCF_Dialect : Dialect {
   let name = "scf";
   let cppNamespace = "::mlir::scf";
   let dependentDialects = ["arith::ArithmeticDialect"];
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 // Base class for SCF dialect ops.
index d5a8a65..aca9215 100644 (file)
@@ -41,7 +41,6 @@ def ShapeDialect : Dialect {
   let useDefaultTypePrinterParser = 1;
   let hasConstantMaterializer = 1;
   let hasOperationAttrVerify = 1;
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 class Shape_Type<string name, string typeMnemonic> : TypeDef<ShapeDialect, name> {
index 2534bf1..eebbef3 100644 (file)
@@ -78,8 +78,6 @@ def SparseTensor_Dialect : Dialect {
   }];
 
   let useDefaultAttributePrinterParser = 1;
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 #endif // SPARSETENSOR_BASE
index b90ad98..9bf174d 100644 (file)
@@ -50,8 +50,6 @@ def Tensor_Dialect : Dialect {
     "arith::ArithmeticDialect",
     "complex::ComplexDialect",
   ];
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 #endif // TENSOR_BASE
index baf5596..0f08983 100644 (file)
@@ -45,8 +45,6 @@ def Tosa_Dialect : Dialect {
   let cppNamespace = "mlir::tosa";
   let hasConstantMaterializer = 1;
   let useDefaultAttributePrinterParser = 1;
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 //===----------------------------------------------------------------------===//
index bf1a522..54ff0f0 100644 (file)
@@ -299,7 +299,6 @@ def Transform_Dialect : Dialect {
 
   let name = "transform";
   let cppNamespace = "::mlir::transform";
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 
   let dependentDialects = [
     "::mlir::pdl::PDLDialect",
index d2fe879..9a41bda 100644 (file)
@@ -27,7 +27,6 @@ def Vector_Dialect : Dialect {
   let useDefaultAttributePrinterParser = 1;
   let hasConstantMaterializer = 1;
   let dependentDialects = ["arith::ArithmeticDialect"];
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 // Base class for Vector dialect ops.
index c677045..03fa89e 100644 (file)
@@ -24,8 +24,6 @@ include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
 def X86Vector_Dialect : Dialect {
   let name = "x86vector";
   let cppNamespace = "::mlir::x86vector";
-
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 //===----------------------------------------------------------------------===//
index 69cb01d..a3d0f0c 100644 (file)
@@ -34,7 +34,6 @@ def Builtin_Dialect : Dialect {
 
   public:
   }];
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 
 #endif // BUILTIN_BASE
index df0a164..f2f0790 100644 (file)
@@ -97,7 +97,7 @@ class Dialect {
   // leaving UpperCamel unchanged while also converting lowerCamel to
   // UpperCamel) and prefixed with `get` or `set` depending on if it is a getter
   // or setter.
-  int emitAccessorPrefix = kEmitAccessorPrefix_Raw;
+  int emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 
   // If this dialect can be extended at runtime with new operations or types.
   bit isExtensible = 0;
index dbfc315..9404667 100644 (file)
@@ -727,7 +727,7 @@ getGetterOrSetterNames(bool isGetter, const Operator &op, StringRef name) {
       shouldSkip = true;
     }
     if (newName == "getType") {
-      if (op.getNumResults() == 0)
+      if (op.getNumResults() != 1)
         return false;
       shouldSkip = true;
     }
index d13d6ab..0bc789f 100644 (file)
@@ -14,7 +14,6 @@ include "mlir/IR/OpBase.td"
 def Test_Dialect : Dialect {
   let name = "test";
   let cppNamespace = "::test";
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
   let hasCanonicalizer = 1;
   let hasConstantMaterializer = 1;
   let hasOperationAttrVerify = 1;
index 3e632d7..ac18ded 100644 (file)
@@ -171,7 +171,6 @@ def AOp : NS_Op<"a_op", []> {
 def Test2_Dialect : Dialect {
   let name = "test2";
   let cppNamespace = "foobar2";
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 def AgetOp : Op<Test2_Dialect, "a_get_op", []> {
   let arguments = (ins
index 76d76c9..c644a17 100644 (file)
@@ -12,7 +12,6 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
 def Test_Dialect : Dialect {
   let name = "test";
   let cppNamespace = "NS";
-  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
 }
 class NS_Op<string mnemonic, list<Trait> traits> :
     Op<Test_Dialect, mnemonic, traits>;