[flang-commits] [flang] a6cef03 - [mlir] Remove the `type` keyword from type alias definitions

River Riddle via flang-commits flang-commits at lists.llvm.org
Mon May 16 13:57:22 PDT 2022


Author: River Riddle
Date: 2022-05-16T13:54:02-07:00
New Revision: a6cef03f66ca76169ba629d21f1245b50b646ee0

URL: https://github.com/llvm/llvm-project/commit/a6cef03f66ca76169ba629d21f1245b50b646ee0
DIFF: https://github.com/llvm/llvm-project/commit/a6cef03f66ca76169ba629d21f1245b50b646ee0.diff

LOG: [mlir] Remove the `type` keyword from type alias definitions

This was carry over from LLVM IR where the alias definition can
be ambiguous, but MLIR type aliases have no such problems.
Having the `type` keyword is superfluous and doesn't add anything.
This commit drops it, which also nicely aligns with the syntax for
attribute aliases (which doesn't have a keyword).

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

Added: 
    

Modified: 
    flang/include/flang/Optimizer/Dialect/FIROps.td
    flang/test/Fir/affine-promotion.fir
    flang/test/Fir/array-value-copy-3.fir
    flang/test/Fir/ignore-missing-type-descriptor.fir
    flang/test/Fir/recursive-type.fir
    mlir/docs/LangRef.md
    mlir/docs/TargetLLVMIR.md
    mlir/lib/IR/AsmPrinter.cpp
    mlir/lib/Parser/Parser.cpp
    mlir/test/Conversion/FuncToLLVM/func-memref.mlir
    mlir/test/Dialect/LLVMIR/types.mlir
    mlir/test/Dialect/Linalg/standard.mlir
    mlir/test/Dialect/Quant/parse-any-invalid.mlir
    mlir/test/Dialect/Quant/parse-any.mlir
    mlir/test/Dialect/Quant/parse-calibrated-invalid.mlir
    mlir/test/Dialect/Quant/parse-calibrated.mlir
    mlir/test/Dialect/Quant/parse-uniform-invalid.mlir
    mlir/test/Dialect/Quant/parse-uniform.mlir
    mlir/test/IR/invalid-unregistered.mlir
    mlir/test/IR/invalid.mlir
    mlir/test/IR/parser.mlir
    mlir/test/IR/print-attr-type-aliases.mlir
    mlir/test/Integration/Dialect/Linalg/CPU/benchmark_matmul.mlir
    mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir
    mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_flatten.mlir
    mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_matvec.mlir
    mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_mttkrp.mlir
    mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_simple.mlir
    mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sampled_matmul.mlir
    mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_spmm.mlir
    mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sum.mlir
    mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_pytaco_utils.py
    mlir/test/Integration/Dialect/Vector/CPU/test-outerproduct-f32.mlir
    mlir/test/Integration/Dialect/Vector/CPU/test-outerproduct-i64.mlir
    mlir/test/mlir-cpu-runner/utils.mlir
    mlir/utils/tree-sitter-mlir/grammar.js

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Optimizer/Dialect/FIROps.td b/flang/include/flang/Optimizer/Dialect/FIROps.td
index 2d71d136e8d23..bb652c10016e0 100644
--- a/flang/include/flang/Optimizer/Dialect/FIROps.td
+++ b/flang/include/flang/Optimizer/Dialect/FIROps.td
@@ -2576,7 +2576,7 @@ def fir_GenTypeDescOp : fir_OneResultOp<"gentypedesc", [NoSideEffect]> {
     is `!fir.tdesc<T>`.
 
     ```mlir
-      !T = type !fir.type<T{...}>
+      !T = !fir.type<T{...}>
       %t = fir.gentypedesc !T  // returns value of !fir.tdesc<!T>
     ```
   }];

diff  --git a/flang/test/Fir/affine-promotion.fir b/flang/test/Fir/affine-promotion.fir
index 51eb0d05cbd85..9009cbb723982 100644
--- a/flang/test/Fir/affine-promotion.fir
+++ b/flang/test/Fir/affine-promotion.fir
@@ -2,7 +2,7 @@
 
 // RUN: fir-opt --split-input-file --promote-to-affine --affine-loop-invariant-code-motion --cse %s | FileCheck %s
 
-!arr_d1 = type !fir.ref<!fir.array<?xf32>>
+!arr_d1 = !fir.ref<!fir.array<?xf32>>
 #arr_len = affine_map<()[j1,k1] -> (k1 - j1 + 1)>
 
 func.func @loop_with_load_and_store(%a1: !arr_d1, %a2: !arr_d1, %a3: !arr_d1) {
@@ -75,7 +75,7 @@ func.func @loop_with_load_and_store(%a1: !arr_d1, %a2: !arr_d1, %a3: !arr_d1) {
 
 // -----
 
-!arr_d1 = type !fir.ref<!fir.array<?xf32>>
+!arr_d1 = !fir.ref<!fir.array<?xf32>>
 #arr_len = affine_map<()[j1,k1] -> (k1 - j1 + 1)>
 
 func.func @loop_with_if(%a: !arr_d1, %v: f32) {

diff  --git a/flang/test/Fir/array-value-copy-3.fir b/flang/test/Fir/array-value-copy-3.fir
index fe4693b01dc40..465bdab18fa70 100644
--- a/flang/test/Fir/array-value-copy-3.fir
+++ b/flang/test/Fir/array-value-copy-3.fir
@@ -6,7 +6,7 @@
 // RUN: fir-opt --array-value-copy %s | FileCheck %s
 
 
-!t_with_alloc_comp = type !fir.type<t{i:!fir.box<!fir.heap<!fir.array<?xi32>>>}>
+!t_with_alloc_comp = !fir.type<t{i:!fir.box<!fir.heap<!fir.array<?xi32>>>}>
 func.func private @custom_assign(!fir.ref<!t_with_alloc_comp>, !fir.ref<!t_with_alloc_comp>)
 func.func @test_overlap_with_alloc_components(%arg0: !fir.ref<!fir.array<10x!t_with_alloc_comp>>) {
   %0 = fir.alloca !fir.box<!t_with_alloc_comp>

diff  --git a/flang/test/Fir/ignore-missing-type-descriptor.fir b/flang/test/Fir/ignore-missing-type-descriptor.fir
index ec8204c86da39..ecd82bbb85b7c 100644
--- a/flang/test/Fir/ignore-missing-type-descriptor.fir
+++ b/flang/test/Fir/ignore-missing-type-descriptor.fir
@@ -4,7 +4,7 @@
 // Missing derived type descriptor pointers are replaced by null pointers.
 // RUN: tco --ignore-missing-type-desc -o - %s | FileCheck %s
 
-!some_freestyle_type = type !fir.type<some_not_mangled_type{j:i32}>
+!some_freestyle_type = !fir.type<some_not_mangled_type{j:i32}>
 
 func.func private @bar(!fir.box<!some_freestyle_type>)
 

diff  --git a/flang/test/Fir/recursive-type.fir b/flang/test/Fir/recursive-type.fir
index 6c0b800540c79..3bfe29b60cc7f 100644
--- a/flang/test/Fir/recursive-type.fir
+++ b/flang/test/Fir/recursive-type.fir
@@ -5,10 +5,10 @@
 // RUN: fir-opt --fir-to-llvm-ir="target=i386-unknown-linux-gnu" %s | FileCheck %s
 // RUN: fir-opt --fir-to-llvm-ir="target=powerpc64le-unknown-linux-gn" %s | FileCheck %s
 
-!t1 = type !fir.type<t1 {a1:!fir.ptr<!fir.type<t1>>}>
-!t2 = type !fir.type<t2 {b1:f32,b2:!fir.ptr<!fir.type<t2>>,b3:i32,b4:!fir.ptr<!fir.type<t2>>}>
-!t3 = type !fir.type<t3 {c1:!fir.ptr<!fir.type<t4>>}>
-!t4 = type !fir.type<t4 {d1:!fir.ptr<!fir.type<t3>>}>
+!t1 = !fir.type<t1 {a1:!fir.ptr<!fir.type<t1>>}>
+!t2 = !fir.type<t2 {b1:f32,b2:!fir.ptr<!fir.type<t2>>,b3:i32,b4:!fir.ptr<!fir.type<t2>>}>
+!t3 = !fir.type<t3 {c1:!fir.ptr<!fir.type<t4>>}>
+!t4 = !fir.type<t4 {d1:!fir.ptr<!fir.type<t3>>}>
 
 // CHECK-LABEL: llvm.func @recursiveTypes
 // CHECK-SAME: %{{.*}}: !llvm.struct<"[[T1:.*]]", (ptr<struct<"[[T1]]">>)>

diff  --git a/mlir/docs/LangRef.md b/mlir/docs/LangRef.md
index ab2e281700a90..cb383be7256ea 100644
--- a/mlir/docs/LangRef.md
+++ b/mlir/docs/LangRef.md
@@ -657,7 +657,7 @@ function-type ::= (type | type-list-parens) `->` (type | type-list-parens)
 ### Type Aliases
 
 ```
-type-alias-def ::= '!' alias-name '=' 'type' type
+type-alias-def ::= '!' alias-name '=' type
 type-alias ::= '!' alias-name
 ```
 
@@ -669,7 +669,7 @@ names are reserved for [dialect types](#dialect-types).
 Example:
 
 ```mlir
-!avx_m128 = type vector<4 x f32>
+!avx_m128 = vector<4 x f32>
 
 // Using the original type.
 "foo"(%x) : vector<4 x f32> -> ()

diff  --git a/mlir/docs/TargetLLVMIR.md b/mlir/docs/TargetLLVMIR.md
index 6ebe149d57a3e..bd36847c23347 100644
--- a/mlir/docs/TargetLLVMIR.md
+++ b/mlir/docs/TargetLLVMIR.md
@@ -367,8 +367,7 @@ func.func @foo(%arg0: memref<?xf32>) -> () {
 
 // Gets converted to the following
 // (using type alias for brevity):
-!llvm.memref_1d = type !llvm.struct<(ptr<f32>, ptr<f32>, i64,
-                                     array<1xi64>, array<1xi64>)>
+!llvm.memref_1d = !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<1xi64>, array<1xi64>)>
 
 llvm.func @foo(%arg0: !llvm.ptr<f32>,  // Allocated pointer.
                %arg1: !llvm.ptr<f32>,  // Aligned pointer.
@@ -398,8 +397,7 @@ func.func @bar() {
 
 // Gets converted to the following
 // (using type alias for brevity):
-!llvm.memref_1d = type !llvm.struct<(ptr<f32>, ptr<f32>, i64,
-                                     array<1xi64>, array<1xi64>)>
+!llvm.memref_1d = !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<1xi64>, array<1xi64>)>
 
 llvm.func @bar() {
   %0 = "get"() : () -> !llvm.memref_1d
@@ -619,8 +617,7 @@ func.func @qux(%arg0: memref<?x?xf32>)
 
 // Gets converted into the following
 // (using type alias for brevity):
-!llvm.memref_2d = type !llvm.struct<(ptr<f32>, ptr<f32>, i64,
-                                     array<2xi64>, array<2xi64>)>
+!llvm.memref_2d = !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2xi64>, array<2xi64>)>
 
 // Function with unpacked arguments.
 llvm.func @qux(%arg0: !llvm.ptr<f32>, %arg1: !llvm.ptr<f32>,
@@ -665,10 +662,8 @@ func.func @foo(%arg0: memref<?x?xf32>) {
 
 // Gets converted into the following
 // (using type alias for brevity):
-!llvm.memref_2d = type !llvm.struct<(ptr<f32>, ptr<f32>, i64,
-                                     array<2xi64>, array<2xi64>)>
-!llvm.memref_2d_ptr = type !llvm.ptr<struct<(ptr<f32>, ptr<f32>, i64,
-                                             array<2xi64>, array<2xi64>)>>
+!llvm.memref_2d = !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2xi64>, array<2xi64>)>
+!llvm.memref_2d_ptr = !llvm.ptr<struct<(ptr<f32>, ptr<f32>, i64, array<2xi64>, array<2xi64>)>>
 
 // Function with unpacked arguments.
 llvm.func @foo(%arg0: !llvm.ptr<f32>, %arg1: !llvm.ptr<f32>,
@@ -704,10 +699,8 @@ func.func @foo(%arg0: memref<?x?xf32>) -> memref<?x?xf32> {
 
 // Gets converted into the following
 // (using type alias for brevity):
-!llvm.memref_2d = type !llvm.struct<(ptr<f32>, ptr<f32>, i64,
-                                     array<2xi64>, array<2xi64>)>
-!llvm.memref_2d_ptr = type !llvm.ptr<struct<(ptr<f32>, ptr<f32>, i64,
-                                             array<2xi64>, array<2xi64>)>>
+!llvm.memref_2d = !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<2xi64>, array<2xi64>)>
+!llvm.memref_2d_ptr = !llvm.ptr<struct<(ptr<f32>, ptr<f32>, i64, array<2xi64>, array<2xi64>)>>
 
 // Function with unpacked arguments.
 llvm.func @foo(%arg0: !llvm.ptr<f32>, %arg1: !llvm.ptr<f32>, %arg2: i64,

diff  --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp
index e4d5c6d91459e..0836055494310 100644
--- a/mlir/lib/IR/AsmPrinter.cpp
+++ b/mlir/lib/IR/AsmPrinter.cpp
@@ -822,7 +822,7 @@ void AliasState::printAliases(raw_ostream &os, NewLineCounter &newLine,
   }
   for (const auto &it : llvm::make_filter_range(typeToAlias, filterFn)) {
     it.second.print(os << '!');
-    os << " = type " << it.first << newLine;
+    os << " = " << it.first << newLine;
   }
 }
 

diff  --git a/mlir/lib/Parser/Parser.cpp b/mlir/lib/Parser/Parser.cpp
index 1f88353c1bc21..06b2810a2ec1e 100644
--- a/mlir/lib/Parser/Parser.cpp
+++ b/mlir/lib/Parser/Parser.cpp
@@ -2105,7 +2105,7 @@ ParseResult TopLevelOperationParser::parseAttributeAliasDef() {
 
 /// Parse a type alias declaration.
 ///
-///   type-alias-def ::= '!' alias-name `=` 'type' type
+///   type-alias-def ::= '!' alias-name `=` type
 ///
 ParseResult TopLevelOperationParser::parseTypeAliasDef() {
   assert(getToken().is(Token::exclamation_identifier));
@@ -2119,12 +2119,10 @@ ParseResult TopLevelOperationParser::parseTypeAliasDef() {
   if (aliasName.contains('.'))
     return emitError("type names with a '.' are reserved for "
                      "dialect-defined names");
-
   consumeToken(Token::exclamation_identifier);
 
-  // Parse the '=' and 'type'.
-  if (parseToken(Token::equal, "expected '=' in type alias definition") ||
-      parseToken(Token::kw_type, "expected 'type' in type alias definition"))
+  // Parse the '='.
+  if (parseToken(Token::equal, "expected '=' in type alias definition"))
     return failure();
 
   // Parse the type.

diff  --git a/mlir/test/Conversion/FuncToLLVM/func-memref.mlir b/mlir/test/Conversion/FuncToLLVM/func-memref.mlir
index d43c9ac74f823..48a319b3ee283 100644
--- a/mlir/test/Conversion/FuncToLLVM/func-memref.mlir
+++ b/mlir/test/Conversion/FuncToLLVM/func-memref.mlir
@@ -101,7 +101,7 @@ func.func @check_scalar_func_call(%in : f32) {
 
 // -----
 
-!base_type = type memref<64xi32, 201>
+!base_type = memref<64xi32, 201>
 
 // CHECK-LABEL: func @loop_carried
 // BAREPTR-LABEL: func @loop_carried

diff  --git a/mlir/test/Dialect/LLVMIR/types.mlir b/mlir/test/Dialect/LLVMIR/types.mlir
index 22ba9f03aa304..54c44a6aa58ab 100644
--- a/mlir/test/Dialect/LLVMIR/types.mlir
+++ b/mlir/test/Dialect/LLVMIR/types.mlir
@@ -197,10 +197,10 @@ func.func @ptr_elem_interface(%arg0: !llvm.ptr<!test.smpla>) {
 // DialectAsmPrinter to have a mechanism for querying the presence and
 // usability of an alias outside of its `printType` method.
 
-!baz = type i64
-!qux = type !llvm.struct<(!baz)>
+!baz = i64
+!qux = !llvm.struct<(!baz)>
 
-!rec = type !llvm.struct<"a", (ptr<struct<"a">>)>
+!rec = !llvm.struct<"a", (ptr<struct<"a">>)>
 
 // CHECK: aliases
 llvm.func @aliases() {

diff  --git a/mlir/test/Dialect/Linalg/standard.mlir b/mlir/test/Dialect/Linalg/standard.mlir
index 586588ff27f68..e51529d667d62 100644
--- a/mlir/test/Dialect/Linalg/standard.mlir
+++ b/mlir/test/Dialect/Linalg/standard.mlir
@@ -37,13 +37,13 @@ func.func @dot(%arg0: memref<?xf32, offset: ?, strides: [1]>,
   library_call = "external_outerproduct_matmul"
 }
 
-!vector_type_A = type vector<4xf32>
-!vector_type_B = type vector<4xf32>
-!vector_type_C = type vector<4x4xf32>
+!vector_type_A = vector<4xf32>
+!vector_type_B = vector<4xf32>
+!vector_type_C = vector<4x4xf32>
 
-!matrix_type_A = type memref<?x?x!vector_type_A>
-!matrix_type_B = type memref<?x?x!vector_type_B>
-!matrix_type_C = type memref<?x?x!vector_type_C>
+!matrix_type_A = memref<?x?x!vector_type_A>
+!matrix_type_B = memref<?x?x!vector_type_B>
+!matrix_type_C = memref<?x?x!vector_type_C>
 
 func.func @matmul_vec_impl(%A: !matrix_type_A, %B: !matrix_type_B, %C: !matrix_type_C) {
   linalg.generic #matmul_trait

diff  --git a/mlir/test/Dialect/Quant/parse-any-invalid.mlir b/mlir/test/Dialect/Quant/parse-any-invalid.mlir
index 850174b4bd989..ca428e169245f 100644
--- a/mlir/test/Dialect/Quant/parse-any-invalid.mlir
+++ b/mlir/test/Dialect/Quant/parse-any-invalid.mlir
@@ -3,59 +3,59 @@
 // -----
 // Unrecognized token: missing storage type maximum
 // expected-error at +1 {{expected ':'}}
-!qalias = type !quant.any<i8<16>:f32>
+!qalias = !quant.any<i8<16>:f32>
 
 // -----
 // Unrecognized token: missing closing angle bracket
 // expected-error at +1 {{expected '>'}}
-!qalias = type !quant<"any<i8<-4:3:f32>">
+!qalias = !quant<"any<i8<-4:3:f32>">
 
 // -----
 // Unrecognized token: missing type colon
 // expected-error at +1 {{expected '>'}}
-!qalias = type !quant.any<i8<-4:3>f32>
+!qalias = !quant.any<i8<-4:3>f32>
 
 // -----
 // Unrecognized storage type: illegal prefix
 // expected-error at +1 {{illegal storage type prefix}}
-!qalias = type !quant.any<int8<-4:3>:f32>
+!qalias = !quant.any<int8<-4:3>:f32>
 
 // -----
 // Unrecognized storage type: no width
 // expected-error at +1 {{illegal storage type prefix}}
-!qalias = type !quant.any<i<-4:3>:f32>
+!qalias = !quant.any<i<-4:3>:f32>
 
 // -----
 // Unrecognized storage type: storage size > 32
 // expected-error at +1 {{illegal storage type size: 33}}
-!qalias = type !quant.any<i33:f32>
+!qalias = !quant.any<i33:f32>
 
 // -----
 // Unrecognized storage type: storage size < 0
 // expected-error at +1 {{illegal storage type size: 1024}}
-!qalias = type !quant.any<i1024<-4:3>:f32>
+!qalias = !quant.any<i1024<-4:3>:f32>
 
 // -----
 // Unrecognized storage type: storage size
 // expected-error at +1 {{invalid integer width}}
-!qalias = type !quant.any<i0123123123123123<-4:3>:f32>
+!qalias = !quant.any<i0123123123123123<-4:3>:f32>
 
 // -----
 // Illegal storage min/max: max - min < 0
 // expected-error at +1 {{illegal storage min and storage max: (2:1)}}
-!qalias = type !quant.any<i8<2:1>:f32>
+!qalias = !quant.any<i8<2:1>:f32>
 
 // -----
 // Illegal storage min/max: max - min == 0
 // expected-error at +1 {{illegal storage min and storage max: (1:1)}}
-!qalias = type !quant.any<i8<1:1>:f32>
+!qalias = !quant.any<i8<1:1>:f32>
 
 // -----
 // Illegal storage min/max: max > defaultMax
 // expected-error at +1 {{illegal storage type maximum: 9}}
-!qalias = type !quant.any<i4<-1:9>:f32>
+!qalias = !quant.any<i4<-1:9>:f32>
 
 // -----
 // Illegal storage min/max: min < defaultMin
 // expected-error at +1 {{illegal storage type minimum: -9}}
-!qalias = type !quant.any<i4<-9:1>:f32>
+!qalias = !quant.any<i4<-9:1>:f32>

diff  --git a/mlir/test/Dialect/Quant/parse-any.mlir b/mlir/test/Dialect/Quant/parse-any.mlir
index 74438b52cb9a6..11b15755953cf 100644
--- a/mlir/test/Dialect/Quant/parse-any.mlir
+++ b/mlir/test/Dialect/Quant/parse-any.mlir
@@ -3,7 +3,7 @@
 // -----
 // CHECK-LABEL: parseFullySpecified
 // CHECK: !quant.any<i8<-8:7>:f32>
-!qalias = type !quant.any<i8<-8:7>:f32>
+!qalias = !quant.any<i8<-8:7>:f32>
 func.func @parseFullySpecified() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -12,7 +12,7 @@ func.func @parseFullySpecified() -> !qalias {
 // -----
 // CHECK-LABEL: parseNoExpressedType
 // CHECK: !quant.any<i8<-8:7>>
-!qalias = type !quant.any<i8<-8:7>>
+!qalias = !quant.any<i8<-8:7>>
 func.func @parseNoExpressedType() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -21,7 +21,7 @@ func.func @parseNoExpressedType() -> !qalias {
 // -----
 // CHECK-LABEL: parseOnlyStorageType
 // CHECK: !quant.any<i8>
-!qalias = type !quant.any<i8>
+!qalias = !quant.any<i8>
 func.func @parseOnlyStorageType() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias

diff  --git a/mlir/test/Dialect/Quant/parse-calibrated-invalid.mlir b/mlir/test/Dialect/Quant/parse-calibrated-invalid.mlir
index eefc0dfd33825..fbeb20b951964 100644
--- a/mlir/test/Dialect/Quant/parse-calibrated-invalid.mlir
+++ b/mlir/test/Dialect/Quant/parse-calibrated-invalid.mlir
@@ -4,25 +4,25 @@
 // Unrecognized token: missing calibrated type maximum
 // expected-error at +2 {{calibrated values must be present}}
 // expected-error at +1 {{expected ':'}}
-!qalias = type !quant.calibrated<f32<-0.998>>
+!qalias = !quant.calibrated<f32<-0.998>>
 
 // -----
 // Unrecognized token: missing closing angle bracket
 // expected-error at +1 {{expected '>'}}
-!qalias = type !quant<"calibrated<f32<-0.998:1.232>">
+!qalias = !quant<"calibrated<f32<-0.998:1.232>">
 
 // -----
 // Unrecognized expressed type: integer type
 // expected-error at +2 {{invalid kind of type specified}}
 // expected-error at +1 {{expecting float expressed type}}
-!qalias = type !quant.calibrated<i8<-4:3>>
+!qalias = !quant.calibrated<i8<-4:3>>
 
 // -----
 // Illegal storage min/max: max - min < 0
 // expected-error at +1 {{illegal min and max: (1.000000e+00:-1.000000e+00)}}
-!qalias = type !quant.calibrated<f32<1.0:-1.0>>
+!qalias = !quant.calibrated<f32<1.0:-1.0>>
 
 // -----
 // Illegal storage min/max: max - min == 0
 // expected-error at +1 {{illegal min and max: (1.000000e+00:1.000000e+00)}}
-!qalias = type !quant.calibrated<f32<1.0:1.0>>
+!qalias = !quant.calibrated<f32<1.0:1.0>>

diff  --git a/mlir/test/Dialect/Quant/parse-calibrated.mlir b/mlir/test/Dialect/Quant/parse-calibrated.mlir
index d1caa37194d98..b3c5ec0cec443 100644
--- a/mlir/test/Dialect/Quant/parse-calibrated.mlir
+++ b/mlir/test/Dialect/Quant/parse-calibrated.mlir
@@ -3,7 +3,7 @@
 // -----
 // CHECK-LABEL: parseCalibrated
 // CHECK: !quant.calibrated<f32<-0.998:1.232100e+00>
-!qalias = type !quant.calibrated<f32<-0.998:1.2321>>
+!qalias = !quant.calibrated<f32<-0.998:1.2321>>
 func.func @parseCalibrated() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias

diff  --git a/mlir/test/Dialect/Quant/parse-uniform-invalid.mlir b/mlir/test/Dialect/Quant/parse-uniform-invalid.mlir
index f43496f85e0ff..61ea54fe16300 100644
--- a/mlir/test/Dialect/Quant/parse-uniform-invalid.mlir
+++ b/mlir/test/Dialect/Quant/parse-uniform-invalid.mlir
@@ -3,120 +3,120 @@
 // -----
 // Invalid type.
 // expected-error at +1 {{unknown quantized type foobar}}
-!qalias = type !quant.foobar
+!qalias = !quant.foobar
 
 // -----
 // Unrecognized token: illegal token
 // expected-error at +1 {{unknown quantized type __}}
-!qalias = type !quant.__
+!qalias = !quant.__
 
 // -----
 // Unrecognized token: trailing
 // expected-error at +1 {{expected '>'}}
-!qalias = type !quant.uniform<i8<-4:3>:f32, 0.99872:127 23>
+!qalias = !quant.uniform<i8<-4:3>:f32, 0.99872:127 23>
 
 // -----
 // Unrecognized token: missing storage type maximum
 // expected-error at +1 {{expected ':'}}
-!qalias = type !quant.uniform<i8<16>:f32, 0.99872:127>
+!qalias = !quant.uniform<i8<16>:f32, 0.99872:127>
 
 // -----
 // Unrecognized token: missing closing angle bracket
 // expected-error at +1 {{expected '>'}}
-!qalias = type !quant<"uniform<i8<-4:3:f32, 0.99872:127>">
+!qalias = !quant<"uniform<i8<-4:3:f32, 0.99872:127>">
 
 // -----
 // Unrecognized token: missing type colon
 // expected-error at +1 {{expected ':'}}
-!qalias = type !quant.uniform<i8<-4:3>f32, 0.99872:127>
+!qalias = !quant.uniform<i8<-4:3>f32, 0.99872:127>
 
 // -----
 // Unrecognized token: missing comma
 // expected-error at +1 {{expected ','}}
-!qalias = type !quant.uniform<i8<-4:3>:f32 0.99872:127>
+!qalias = !quant.uniform<i8<-4:3>:f32 0.99872:127>
 
 // -----
 // Unrecognized storage type: illegal prefix
 // expected-error at +1 {{illegal storage type prefix}}
-!qalias = type !quant.uniform<int8<-4:3>:f32, 0.99872:127>
+!qalias = !quant.uniform<int8<-4:3>:f32, 0.99872:127>
 
 // -----
 // Unrecognized storage type: no width
 // expected-error at +1 {{illegal storage type prefix}}
-!qalias = type !quant.uniform<i<-4:3>:f32, 0.99872:127>
+!qalias = !quant.uniform<i<-4:3>:f32, 0.99872:127>
 
 // -----
 // Unrecognized storage type: storage size > 32
 // expected-error at +1 {{illegal storage type size: 33}}
-!qalias = type !quant.uniform<i33:f32, 0.99872:127>
+!qalias = !quant.uniform<i33:f32, 0.99872:127>
 
 // -----
 // Unrecognized storage type: storage size < 0
 // expected-error at +1 {{illegal storage type prefix}}
-!qalias = type !quant.uniform<i-1<-4:3>:f32, 0.99872:127>
+!qalias = !quant.uniform<i-1<-4:3>:f32, 0.99872:127>
 
 // -----
 // Unrecognized storage type: storage size
 // expected-error at +1 {{invalid integer width}}
-!qalias = type !quant.uniform<i123123123120<-4:3>:f32, 0.99872:127>
+!qalias = !quant.uniform<i123123123120<-4:3>:f32, 0.99872:127>
 
 // -----
 // Illegal storage min/max: max - min < 0
 // expected-error at +1 {{illegal storage min and storage max: (2:1)}}
-!qalias = type !quant.uniform<i8<2:1>:f32, 0.99872:127>
+!qalias = !quant.uniform<i8<2:1>:f32, 0.99872:127>
 
 // -----
 // Illegal storage min/max: max - min == 0
 // expected-error at +1 {{illegal storage min and storage max: (1:1)}}
-!qalias = type !quant.uniform<i8<1:1>:f32, 0.99872:127>
+!qalias = !quant.uniform<i8<1:1>:f32, 0.99872:127>
 
 // -----
 // Illegal storage min/max: max > defaultMax
 // expected-error at +1 {{illegal storage type maximum: 9}}
-!qalias = type !quant.uniform<i4<-1:9>:f32, 0.99872:127>
+!qalias = !quant.uniform<i4<-1:9>:f32, 0.99872:127>
 
 // -----
 // Illegal storage min/max: min < defaultMin
 // expected-error at +1 {{illegal storage type minimum: -9}}
-!qalias = type !quant.uniform<i4<-9:1>:f32, 0.99872:127>
+!qalias = !quant.uniform<i4<-9:1>:f32, 0.99872:127>
 
 // -----
 // Illegal uniform params: invalid scale
 // expected-error at +1 {{expected floating point literal}}
-!qalias = type !quant.uniform<i8<-4:3>:f32, abc:127>
+!qalias = !quant.uniform<i8<-4:3>:f32, abc:127>
 
 // -----
 // Illegal uniform params: invalid zero point separator
 // expected-error at +1 {{expected '>'}}
-!qalias = type !quant.uniform<i8<-4:3>:f32, 0.1abc>
+!qalias = !quant.uniform<i8<-4:3>:f32, 0.1abc>
 
 // -----
 // Illegal uniform params: missing zero point
 // expected-error at +1 {{expected integer value}}
-!qalias = type !quant.uniform<i8<-4:3>:f32, 0.1:>
+!qalias = !quant.uniform<i8<-4:3>:f32, 0.1:>
 
 // -----
 // Illegal uniform params: invalid zero point
 // expected-error at +1 {{expected integer value}}
-!qalias = type !quant.uniform<i8<-4:3>:f32, 0.1:abc>
+!qalias = !quant.uniform<i8<-4:3>:f32, 0.1:abc>
 
 // -----
 // Illegal expressed type: f33
 // expected-error at +1 {{expected non-function type}}
-!qalias = type !quant.uniform<i8<-4:3>:f33, 0.99872:127>
+!qalias = !quant.uniform<i8<-4:3>:f33, 0.99872:127>
 
 // -----
 // Illegal scale: negative
 // expected-error at +1 {{illegal scale: -1.000000}}
-!qalias = type !quant.uniform<i8<-4:3>:f32, -1.0:127>
+!qalias = !quant.uniform<i8<-4:3>:f32, -1.0:127>
 
 // -----
 // Illegal uniform params: missing quantized dimension
 // expected-error at +1 {{expected integer value}}
-!qalias = type !quant.uniform<i8<-4:3>:f32:, {2.000000e+02:-19.987200e-01:1}>
+!qalias = !quant.uniform<i8<-4:3>:f32:, {2.000000e+02:-19.987200e-01:1}>
 
 // -----
 // Illegal uniform params: unspecified quantized dimension, when multiple scales
 // provided.
 // expected-error at +1 {{expected floating point literal}}
-!qalias = type !quant.uniform<i8<-4:3>:f32, {2.000000e+02,-19.987200e-01:1}>
+!qalias = !quant.uniform<i8<-4:3>:f32, {2.000000e+02,-19.987200e-01:1}>

diff  --git a/mlir/test/Dialect/Quant/parse-uniform.mlir b/mlir/test/Dialect/Quant/parse-uniform.mlir
index 3a3449e658de2..4fbe86d935ea3 100644
--- a/mlir/test/Dialect/Quant/parse-uniform.mlir
+++ b/mlir/test/Dialect/Quant/parse-uniform.mlir
@@ -4,7 +4,7 @@
 // All per-layer params specified:
 //   [signed] storageType, storageTypeMin, storageTypeMax, expressedType, scale, zeroPoint
 // CHECK: !quant.uniform<i8<-8:7>:f32, 9.987200e-01:127>
-!qalias = type !quant.uniform<i8<-8:7>:f32, 0.99872:127>
+!qalias = !quant.uniform<i8<-8:7>:f32, 0.99872:127>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -13,7 +13,7 @@ func.func @parse() -> !qalias {
 // -----
 // Trailing whitespace.
 // CHECK: !quant.uniform<i8<-8:7>:f32, 9.987200e-01:127>
-!qalias = type !quant.uniform<i8<-8:7>:f32, 0.99872:127  >
+!qalias = !quant.uniform<i8<-8:7>:f32, 0.99872:127  >
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -23,7 +23,7 @@ func.func @parse() -> !qalias {
 // Required per-layer params specified:
 //   [unsigned] storageType, expressedType, scale
 // CHECK: !quant.uniform<u8:f32, 9.987200e-01>
-!qalias = type !quant.uniform<u8:f32, 0.99872>
+!qalias = !quant.uniform<u8:f32, 0.99872>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -32,7 +32,7 @@ func.func @parse() -> !qalias {
 // -----
 // Exponential scale (-)
 // CHECK: !quant.uniform<u8:f32, 2.000000e-02>
-!qalias = type !quant.uniform<u8:f32, 2.0e-2>
+!qalias = !quant.uniform<u8:f32, 2.0e-2>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -41,7 +41,7 @@ func.func @parse() -> !qalias {
 // -----
 // Exponential scale (+)
 // CHECK: !quant.uniform<u8:f32, 2.000000e+02>
-!qalias = type !quant.uniform<u8:f32, 2.0e+2>
+!qalias = !quant.uniform<u8:f32, 2.0e+2>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -50,7 +50,7 @@ func.func @parse() -> !qalias {
 // -----
 // Storage type: i16
 // CHECK: !quant.uniform<i16:f32, 2.000000e+02>
-!qalias = type !quant.uniform<i16:f32, 2.0e+2>
+!qalias = !quant.uniform<i16:f32, 2.0e+2>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -59,7 +59,7 @@ func.func @parse() -> !qalias {
 // -----
 // Storage type: u16
 // CHECK: !quant.uniform<u16:f32, 2.000000e+02>
-!qalias = type !quant.uniform<u16:f32, 2.0e+2>
+!qalias = !quant.uniform<u16:f32, 2.0e+2>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -68,7 +68,7 @@ func.func @parse() -> !qalias {
 // -----
 // Storage type: i32
 // CHECK: !quant.uniform<i32:f32, 2.000000e+02>
-!qalias = type !quant.uniform<i32:f32, 2.0e+2>
+!qalias = !quant.uniform<i32:f32, 2.0e+2>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -77,7 +77,7 @@ func.func @parse() -> !qalias {
 // -----
 // Storage type: u32
 // CHECK: !quant.uniform<u32:f32, 2.000000e+02>
-!qalias = type !quant.uniform<u32:f32, 2.0e+2>
+!qalias = !quant.uniform<u32:f32, 2.0e+2>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -86,7 +86,7 @@ func.func @parse() -> !qalias {
 // -----
 // Expressed type: f32
 // CHECK: !quant.uniform<u8:f32, 2.000000e+02>
-!qalias = type !quant.uniform<u8:f32, 2.0e+2>
+!qalias = !quant.uniform<u8:f32, 2.0e+2>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -95,7 +95,7 @@ func.func @parse() -> !qalias {
 // -----
 // Expressed type: f32
 // CHECK: !quant.uniform<u8:f32, 0x41646ABBA0000000:128>
-!qalias = type !quant.uniform<u8:f32, 0x41646ABBA0000000:128>
+!qalias = !quant.uniform<u8:f32, 0x41646ABBA0000000:128>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -104,7 +104,7 @@ func.func @parse() -> !qalias {
 // -----
 // Expressed type: f16
 // CHECK: !quant.uniform<u8:f16, 2.000000e+02>
-!qalias = type !quant.uniform<u8:f16, 2.0e+2>
+!qalias = !quant.uniform<u8:f16, 2.0e+2>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -113,7 +113,7 @@ func.func @parse() -> !qalias {
 // -----
 // Expressed type: f64
 // CHECK: !quant.uniform<u8:f64, 2.000000e+02>
-!qalias = type !quant.uniform<u8:f64, 2.0e+2>
+!qalias = !quant.uniform<u8:f64, 2.0e+2>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -122,7 +122,7 @@ func.func @parse() -> !qalias {
 // -----
 // Expressed type: bf16
 // CHECK: !quant.uniform<u8:bf16, 2.000000e+02>
-!qalias = type !quant.uniform<u8:bf16, 2.0e+2>
+!qalias = !quant.uniform<u8:bf16, 2.0e+2>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -131,7 +131,7 @@ func.func @parse() -> !qalias {
 // -----
 // Per-axis scales and zero points (affine)
 // CHECK: !quant.uniform<u8:f32:1, {2.000000e+02:-120,9.987200e-01:127}>
-!qalias = type !quant.uniform<u8:f32:1, {2.0e+2:-120,0.99872:127}>
+!qalias = !quant.uniform<u8:f32:1, {2.0e+2:-120,0.99872:127}>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -140,7 +140,7 @@ func.func @parse() -> !qalias {
 // -----
 // Per-axis scales and no zero points (fixedpoint)
 // CHECK: !quant.uniform<i8:f32:1, {2.000000e+02,9.987200e-01}>
-!qalias = type !quant.uniform<i8:f32:1, {2.0e+2,0.99872}>
+!qalias = !quant.uniform<i8:f32:1, {2.0e+2,0.99872}>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias
@@ -149,7 +149,7 @@ func.func @parse() -> !qalias {
 // -----
 // Per-axis scales and zero points (mixed affine and fixedpoint)
 // CHECK: !quant.uniform<i8:f32:1, {2.000000e+02,9.987200e-01:120}>
-!qalias = type !quant.uniform<i8:f32:1, {2.0e+2,0.99872:120}>
+!qalias = !quant.uniform<i8:f32:1, {2.0e+2,0.99872:120}>
 func.func @parse() -> !qalias {
   %0 = "foo"() : () -> !qalias
   return %0 : !qalias

diff  --git a/mlir/test/IR/invalid-unregistered.mlir b/mlir/test/IR/invalid-unregistered.mlir
index b059a0be33619..5efcd3acbc5a3 100644
--- a/mlir/test/IR/invalid-unregistered.mlir
+++ b/mlir/test/IR/invalid-unregistered.mlir
@@ -11,4 +11,4 @@
 // -----
 
 // expected-error @below {{type created with unregistered dialect}}
-!type = type !unregistered_dialect.type
+!type = !unregistered_dialect.type

diff  --git a/mlir/test/IR/invalid.mlir b/mlir/test/IR/invalid.mlir
index 7c802954f43ba..2b98485bf8d21 100644
--- a/mlir/test/IR/invalid.mlir
+++ b/mlir/test/IR/invalid.mlir
@@ -881,20 +881,16 @@ func.func @type_alias_unknown(!unknown_alias) -> () { // expected-error {{undefi
 
 // -----
 
-!missing_eq_alias type i32 // expected-error {{expected '=' in type alias definition}}
+!missing_eq_alias i32 // expected-error {{expected '=' in type alias definition}}
 
 // -----
 
-!missing_kw_type_alias = i32 // expected-error {{expected 'type' in type alias definition}}
+!missing_type_alias = // expected-error {{expected non-function type}}
 
 // -----
 
-!missing_type_alias = type // expected-error {{expected non-function type}}
-
-// -----
-
-!redef_alias = type i32
-!redef_alias = type i32 // expected-error {{redefinition of type alias id 'redef_alias'}}
+!redef_alias = i32
+!redef_alias = i32 // expected-error {{redefinition of type alias id 'redef_alias'}}
 
 // -----
 

diff  --git a/mlir/test/IR/parser.mlir b/mlir/test/IR/parser.mlir
index 9f6e754da3e76..4187ae1ffc5d7 100644
--- a/mlir/test/IR/parser.mlir
+++ b/mlir/test/IR/parser.mlir
@@ -832,7 +832,7 @@ func.func @unknown_dialect_type() -> !bar<""> {
 }
 
 // CHECK-LABEL: func @type_alias() -> i32 {
-!i32_type_alias = type i32
+!i32_type_alias = i32
 func.func @type_alias() -> !i32_type_alias {
 
   // Return a non-aliased i32 type.

diff  --git a/mlir/test/IR/print-attr-type-aliases.mlir b/mlir/test/IR/print-attr-type-aliases.mlir
index 286f62c192b9b..0c900a773818a 100644
--- a/mlir/test/IR/print-attr-type-aliases.mlir
+++ b/mlir/test/IR/print-attr-type-aliases.mlir
@@ -15,16 +15,16 @@
 // CHECK-DAG: #test_alias_conflict0_1 = "alias_test:sanitize_conflict_b"
 "test.op"() {alias_test = ["alias_test:sanitize_conflict_a", "alias_test:sanitize_conflict_b"]} : () -> ()
 
-// CHECK-DAG: !tuple = type tuple<i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32>
+// CHECK-DAG: !tuple = tuple<i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32>
 "test.op"() {alias_test = "alias_test:large_tuple"} : () -> (tuple<i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32>)
 
-// CHECK-DAG: !test_tuple = type tuple<!test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla>
+// CHECK-DAG: !test_tuple = tuple<!test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla>
 "test.op"() {alias_test = "alias_test:large_tuple"} : () -> (tuple<!test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla, !test.smpla>)
 
 // CHECK-DAG: #test_encoding = "alias_test:tensor_encoding"
 // CHECK-DAG: tensor<32xf32, #test_encoding>
 "test.op"() : () -> tensor<32xf32, "alias_test:tensor_encoding">
 
-// CHECK-DAG: !test_ui8_ = type !test.int<unsigned, 8>
+// CHECK-DAG: !test_ui8_ = !test.int<unsigned, 8>
 // CHECK-DAG: tensor<32x!test_ui8_>
 "test.op"() : () -> tensor<32x!test.int<unsigned, 8>>

diff  --git a/mlir/test/Integration/Dialect/Linalg/CPU/benchmark_matmul.mlir b/mlir/test/Integration/Dialect/Linalg/CPU/benchmark_matmul.mlir
index b5522bf6d7688..7e669c10a274e 100644
--- a/mlir/test/Integration/Dialect/Linalg/CPU/benchmark_matmul.mlir
+++ b/mlir/test/Integration/Dialect/Linalg/CPU/benchmark_matmul.mlir
@@ -15,12 +15,12 @@
 // RUN: tee -a /dev/stderr | FileCheck %s
 
 
-!elem_type_a = type f32
-!elem_type_b = type f32
-!elem_type_c = type f32
-!row_major_A = type memref<${M}x${K}x!elem_type_a>
-!row_major_B = type memref<${K}x${N}x!elem_type_b>
-!row_major_C = type memref<${M}x${N}x!elem_type_c>
+!elem_type_a = f32
+!elem_type_b = f32
+!elem_type_c = f32
+!row_major_A = memref<${M}x${K}x!elem_type_a>
+!row_major_B = memref<${K}x${N}x!elem_type_b>
+!row_major_C = memref<${M}x${N}x!elem_type_c>
 
 func.func @matmul(%a: !row_major_A, %b: !row_major_B, %c: !row_major_C)
 // TODO: activate manually for now.

diff  --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir
index 4aa18e8617c50..c7d2dcf58c9f0 100644
--- a/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir
+++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir
@@ -5,7 +5,7 @@
 // RUN:  -shared-libs=%mlir_integration_test_dir/libmlir_c_runner_utils%shlibext | \
 // RUN: FileCheck %s
 
-!Filename = type !llvm.ptr<i8>
+!Filename = !llvm.ptr<i8>
 
 #DenseMatrix = #sparse_tensor.encoding<{
   dimLevelType = [ "dense", "dense" ],

diff  --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_flatten.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_flatten.mlir
index d7467b3d59af4..855704d6f60ee 100644
--- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_flatten.mlir
+++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_flatten.mlir
@@ -14,7 +14,7 @@
 // RUN:  -shared-libs=%mlir_integration_test_dir/libmlir_c_runner_utils%shlibext | \
 // RUN: FileCheck %s
 
-!Filename = type !llvm.ptr<i8>
+!Filename = !llvm.ptr<i8>
 
 #SparseTensor = #sparse_tensor.encoding<{
   dimLevelType = [ "compressed", "compressed", "compressed", "compressed",

diff  --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_matvec.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_matvec.mlir
index 517f811d0748a..0a3a7cd8f5e92 100644
--- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_matvec.mlir
+++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_matvec.mlir
@@ -15,7 +15,7 @@
 // RUN:  -shared-libs=%mlir_integration_test_dir/libmlir_c_runner_utils%shlibext | \
 // RUN: FileCheck %s
 
-!Filename = type !llvm.ptr<i8>
+!Filename = !llvm.ptr<i8>
 
 #SparseMatrix = #sparse_tensor.encoding<{
   dimLevelType = [ "dense", "compressed" ],

diff  --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_mttkrp.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_mttkrp.mlir
index 1400d376ae274..c74864c3e71c8 100644
--- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_mttkrp.mlir
+++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_mttkrp.mlir
@@ -14,7 +14,7 @@
 // RUN:  -shared-libs=%mlir_integration_test_dir/libmlir_c_runner_utils%shlibext | \
 // RUN: FileCheck %s
 
-!Filename = type !llvm.ptr<i8>
+!Filename = !llvm.ptr<i8>
 
 #SparseTensor = #sparse_tensor.encoding<{
   dimLevelType = [ "compressed", "compressed", "compressed" ]

diff  --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_simple.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_simple.mlir
index 95bc06de123de..d16ba1dcc604d 100644
--- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_simple.mlir
+++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_simple.mlir
@@ -14,7 +14,7 @@
 // RUN:  -shared-libs=%mlir_integration_test_dir/libmlir_c_runner_utils%shlibext | \
 // RUN: FileCheck %s
 
-!Filename = type !llvm.ptr<i8>
+!Filename = !llvm.ptr<i8>
 
 #DCSR = #sparse_tensor.encoding<{
   dimLevelType = [ "compressed", "compressed" ],

diff  --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sampled_matmul.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sampled_matmul.mlir
index de9c9f1a82101..25b8019c46995 100644
--- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sampled_matmul.mlir
+++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sampled_matmul.mlir
@@ -16,7 +16,7 @@
 // RUN: FileCheck %s
 //
 
-!Filename = type !llvm.ptr<i8>
+!Filename = !llvm.ptr<i8>
 
 #SparseMatrix = #sparse_tensor.encoding<{
   dimLevelType = [ "compressed", "compressed" ],

diff  --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_spmm.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_spmm.mlir
index 6ced1f75c13f0..f0b503f7e32b1 100644
--- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_spmm.mlir
+++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_spmm.mlir
@@ -14,7 +14,7 @@
 // RUN:  -shared-libs=%mlir_integration_test_dir/libmlir_c_runner_utils%shlibext | \
 // RUN: FileCheck %s
 
-!Filename = type !llvm.ptr<i8>
+!Filename = !llvm.ptr<i8>
 
 #SparseMatrix = #sparse_tensor.encoding<{
   dimLevelType = [ "dense", "compressed" ]

diff  --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sum.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sum.mlir
index d14d9567d971f..9396543ea851c 100644
--- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sum.mlir
+++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sum.mlir
@@ -14,7 +14,7 @@
 // RUN:  -shared-libs=%mlir_integration_test_dir/libmlir_c_runner_utils%shlibext | \
 // RUN: FileCheck %s
 
-!Filename = type !llvm.ptr<i8>
+!Filename = !llvm.ptr<i8>
 
 #SparseMatrix = #sparse_tensor.encoding<{
   dimLevelType = [ "compressed", "compressed" ]

diff  --git a/mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_pytaco_utils.py b/mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_pytaco_utils.py
index dce0d9e684111..ce6d3c70bd50c 100644
--- a/mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_pytaco_utils.py
+++ b/mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_pytaco_utils.py
@@ -247,7 +247,7 @@ def _get_create_sparse_tensor_kernel(
 
   # Return the MLIR text kernel.
   return f"""
-!Ptr = type !llvm.ptr<i8>
+!Ptr = !llvm.ptr<i8>
 #enc = #sparse_tensor.encoding<{{
   dimLevelType = [ {sparsity} ]
 }}>
@@ -323,7 +323,7 @@ def _get_output_sparse_tensor_kernel(
 
   # Return the MLIR text kernel.
   return f"""
-!Ptr = type !llvm.ptr<i8>
+!Ptr = !llvm.ptr<i8>
 #enc = #sparse_tensor.encoding<{{
   dimLevelType = [ {sparsity} ]
 }}>

diff  --git a/mlir/test/Integration/Dialect/Vector/CPU/test-outerproduct-f32.mlir b/mlir/test/Integration/Dialect/Vector/CPU/test-outerproduct-f32.mlir
index 8aec3b941280f..c2093c4fa87b7 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/test-outerproduct-f32.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/test-outerproduct-f32.mlir
@@ -3,15 +3,15 @@
 // RUN:   -shared-libs=%mlir_integration_test_dir/libmlir_c_runner_utils%shlibext | \
 // RUN: FileCheck %s
 
-!vector_type_A = type vector<8xf32>
-!vector_type_B = type vector<8xf32>
-!vector_type_C = type vector<8x8xf32>
+!vector_type_A = vector<8xf32>
+!vector_type_B = vector<8xf32>
+!vector_type_C = vector<8x8xf32>
 
-!vector_type_X = type vector<2xf32>
-!vector_type_Y = type vector<3xf32>
-!vector_type_Z = type vector<2x3xf32>
+!vector_type_X = vector<2xf32>
+!vector_type_Y = vector<3xf32>
+!vector_type_Z = vector<2x3xf32>
 
-!vector_type_R = type vector<7xf32>
+!vector_type_R = vector<7xf32>
 
 func.func @vector_outerproduct_splat_8x8(%fa: f32, %fb: f32, %fc: f32) -> !vector_type_C {
   %a = vector.splat %fa: !vector_type_A

diff  --git a/mlir/test/Integration/Dialect/Vector/CPU/test-outerproduct-i64.mlir b/mlir/test/Integration/Dialect/Vector/CPU/test-outerproduct-i64.mlir
index bc70786e01b34..3293047a4148f 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/test-outerproduct-i64.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/test-outerproduct-i64.mlir
@@ -3,15 +3,15 @@
 // RUN:   -shared-libs=%mlir_integration_test_dir/libmlir_c_runner_utils%shlibext | \
 // RUN: FileCheck %s
 
-!vector_type_A = type vector<8xi64>
-!vector_type_B = type vector<8xi64>
-!vector_type_C = type vector<8x8xi64>
+!vector_type_A = vector<8xi64>
+!vector_type_B = vector<8xi64>
+!vector_type_C = vector<8x8xi64>
 
-!vector_type_X = type vector<2xi64>
-!vector_type_Y = type vector<3xi64>
-!vector_type_Z = type vector<2x3xi64>
+!vector_type_X = vector<2xi64>
+!vector_type_Y = vector<3xi64>
+!vector_type_Z = vector<2x3xi64>
 
-!vector_type_R = type vector<7xi64>
+!vector_type_R = vector<7xi64>
 
 func.func @vector_outerproduct_splat_8x8(%ia: i64, %ib: i64, %ic: i64) -> !vector_type_C {
   %a = vector.splat %ia: !vector_type_A

diff  --git a/mlir/test/mlir-cpu-runner/utils.mlir b/mlir/test/mlir-cpu-runner/utils.mlir
index 5724eaf660e23..28df1510ad80c 100644
--- a/mlir/test/mlir-cpu-runner/utils.mlir
+++ b/mlir/test/mlir-cpu-runner/utils.mlir
@@ -51,8 +51,8 @@ func.func @print_3d() {
 
 func.func private @printMemrefF32(memref<*xf32>) attributes { llvm.emit_c_interface }
 
-!vector_type_C = type vector<4x4xf32>
-!matrix_type_CC = type memref<1x1x!vector_type_C>
+!vector_type_C = vector<4x4xf32>
+!matrix_type_CC = memref<1x1x!vector_type_C>
 func.func @vector_splat_2d() {
   %c0 = arith.constant 0 : index
   %f10 = arith.constant 10.0 : f32

diff  --git a/mlir/utils/tree-sitter-mlir/grammar.js b/mlir/utils/tree-sitter-mlir/grammar.js
index 254af1d1caf3a..a1817a35de090 100644
--- a/mlir/utils/tree-sitter-mlir/grammar.js
+++ b/mlir/utils/tree-sitter-mlir/grammar.js
@@ -161,9 +161,9 @@ module.exports = grammar({
                              choice($.type, $.type_list_parens)),
 
     // Type aliases
-    //   type-alias-def ::= '!' alias-name '=' 'type' type
+    //   type-alias-def ::= '!' alias-name '=' type
     //   type-alias ::= '!' alias-name
-    type_alias_def : $ => seq('!', $.alias_name, '=', 'type', $.type),
+    type_alias_def : $ => seq('!', $.alias_name, '=', $.type),
     type_alias : $ => seq('!', $.alias_name),
 
     // Dialect Types


        


More information about the flang-commits mailing list