[Mlir-commits] [mlir] 195730a - [mlir][NFC] Replace references to Identifier with StringAttr

River Riddle llvmlistbot at llvm.org
Tue Nov 16 09:43:30 PST 2021


Author: River Riddle
Date: 2021-11-16T17:36:26Z
New Revision: 195730a6505ac352ae9347010ba701ab5267aad7

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

LOG: [mlir][NFC] Replace references to Identifier with StringAttr

This is part of the replacement of Identifier with StringAttr.

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

Added: 
    

Modified: 
    mlir/docs/DataLayout.md
    mlir/docs/Interfaces.md
    mlir/docs/Tutorials/DataFlowAnalysis.md
    mlir/examples/toy/Ch2/mlir/MLIRGen.cpp
    mlir/examples/toy/Ch3/mlir/MLIRGen.cpp
    mlir/examples/toy/Ch4/mlir/MLIRGen.cpp
    mlir/examples/toy/Ch5/mlir/MLIRGen.cpp
    mlir/examples/toy/Ch6/mlir/MLIRGen.cpp
    mlir/examples/toy/Ch7/mlir/MLIRGen.cpp
    mlir/include/mlir/CAPI/IR.h
    mlir/include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.td
    mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
    mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
    mlir/include/mlir/Dialect/DLTI/DLTI.h
    mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
    mlir/include/mlir/IR/Attributes.h
    mlir/include/mlir/IR/Builders.h
    mlir/include/mlir/IR/BuiltinAttributes.td
    mlir/include/mlir/IR/BuiltinLocationAttributes.td
    mlir/include/mlir/IR/BuiltinTypes.h
    mlir/include/mlir/IR/BuiltinTypes.td
    mlir/include/mlir/IR/FunctionSupport.h
    mlir/include/mlir/IR/OpBase.td
    mlir/include/mlir/IR/Operation.h
    mlir/include/mlir/IR/OperationSupport.h
    mlir/include/mlir/Interfaces/DataLayoutInterfaces.h
    mlir/include/mlir/Interfaces/DataLayoutInterfaces.td
    mlir/include/mlir/Pass/PassInstrumentation.h
    mlir/include/mlir/Pass/PassManager.h
    mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h
    mlir/lib/CAPI/IR/BuiltinAttributes.cpp
    mlir/lib/CAPI/IR/IR.cpp
    mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h
    mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
    mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
    mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
    mlir/lib/Conversion/PDLToPDLInterp/Predicate.h
    mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp
    mlir/lib/Dialect/Affine/Utils/Utils.cpp
    mlir/lib/Dialect/DLTI/DLTI.cpp
    mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp
    mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
    mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
    mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
    mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
    mlir/lib/Dialect/Shape/IR/Shape.cpp
    mlir/lib/IR/AttributeDetail.h
    mlir/lib/IR/Builders.cpp
    mlir/lib/IR/BuiltinAttributes.cpp
    mlir/lib/IR/BuiltinDialect.cpp
    mlir/lib/IR/BuiltinTypes.cpp
    mlir/lib/IR/Dialect.cpp
    mlir/lib/IR/Location.cpp
    mlir/lib/IR/MLIRContext.cpp
    mlir/lib/IR/Operation.cpp
    mlir/lib/IR/OperationSupport.cpp
    mlir/lib/IR/SymbolTable.cpp
    mlir/lib/IR/TypeDetail.h
    mlir/lib/Interfaces/DataLayoutInterfaces.cpp
    mlir/lib/Parser/AttributeParser.cpp
    mlir/lib/Parser/DialectSymbolParser.cpp
    mlir/lib/Parser/Lexer.cpp
    mlir/lib/Parser/LocationParser.cpp
    mlir/lib/Pass/Pass.cpp
    mlir/lib/Pass/PassTiming.cpp
    mlir/lib/Rewrite/ByteCode.cpp
    mlir/lib/Rewrite/ByteCode.h
    mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
    mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
    mlir/lib/Transforms/LocationSnapshot.cpp
    mlir/test/lib/Dialect/Linalg/TestLinalgDistribution.cpp
    mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp
    mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp
    mlir/test/lib/Dialect/Shape/TestShapeFunctions.cpp
    mlir/test/lib/Dialect/Test/TestDialect.cpp
    mlir/test/mlir-tblgen/op-attribute.td
    mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
    mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
    mlir/tools/mlir-tblgen/RewriterGen.cpp
    mlir/tools/mlir-tblgen/StructsGen.cpp
    mlir/unittests/IR/AttributeTest.cpp
    mlir/unittests/IR/OperationSupportTest.cpp
    mlir/unittests/TableGen/OpBuildGen.cpp
    mlir/unittests/TableGen/StructsGenTest.cpp
    mlir/utils/gdb-scripts/prettyprinters.py

Removed: 
    


################################################################################
diff  --git a/mlir/docs/DataLayout.md b/mlir/docs/DataLayout.md
index abf53e25c5e27..4ffbf036087a8 100644
--- a/mlir/docs/DataLayout.md
+++ b/mlir/docs/DataLayout.md
@@ -102,7 +102,7 @@ conceptually a collection of key-value pairs called data layout specification
 _entries_. Data layout specification attributes implement the
 `DataLayoutSpecInterface`, described below. Each entry is itself an attribute
 that implements the `DataLayoutEntryInterface`. Entries have a key, either a
-`Type` or an `Identifier`, and a value. Keys are used to associate entries with
+`Type` or a `StringAttr`, and a value. Keys are used to associate entries with
 specific types or dialects: when handling a data layout properties request, a
 type or a dialect can only see the specification entries relevant to them and
 must go through the supplied `DataLayout` object for any recursive query. This

diff  --git a/mlir/docs/Interfaces.md b/mlir/docs/Interfaces.md
index 7a6f7835fe651..30fb86ceba5e1 100644
--- a/mlir/docs/Interfaces.md
+++ b/mlir/docs/Interfaces.md
@@ -327,7 +327,7 @@ operations by overriding the `getRegisteredInterfaceForOp` method :
 
 ```c++
 void *TestDialect::getRegisteredInterfaceForOp(TypeID typeID,
-                                               Identifier opName) {
+                                               StringAttr opName) {
   if (typeID == TypeID::get<ExampleOpInterface>()) {
     if (isSupported(opName))
       return fallbackExampleOpInterface;

diff  --git a/mlir/docs/Tutorials/DataFlowAnalysis.md b/mlir/docs/Tutorials/DataFlowAnalysis.md
index ee8d9cf80c0e7..8265eff8b6ec7 100644
--- a/mlir/docs/Tutorials/DataFlowAnalysis.md
+++ b/mlir/docs/Tutorials/DataFlowAnalysis.md
@@ -137,7 +137,7 @@ struct MetadataLatticeValue {
 
   /// Our value represents the combined metadata, which is originally a
   /// DictionaryAttr, so we use a map.
-  DenseMap<Identifier, Attribute> metadata;
+  DenseMap<StringAttr, Attribute> metadata;
 };
 ```
 

diff  --git a/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp
index 39b8681b22473..e4df32932003e 100644
--- a/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch2/mlir/MLIRGen.cpp
@@ -93,7 +93,7 @@ class MLIRGenImpl {
 
   /// Helper conversion for a Toy AST location to an MLIR location.
   mlir::Location loc(Location loc) {
-    return mlir::FileLineColLoc::get(builder.getIdentifier(*loc.file), loc.line,
+    return mlir::FileLineColLoc::get(builder.getStringAttr(*loc.file), loc.line,
                                      loc.col);
   }
 

diff  --git a/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp
index 39b8681b22473..e4df32932003e 100644
--- a/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch3/mlir/MLIRGen.cpp
@@ -93,7 +93,7 @@ class MLIRGenImpl {
 
   /// Helper conversion for a Toy AST location to an MLIR location.
   mlir::Location loc(Location loc) {
-    return mlir::FileLineColLoc::get(builder.getIdentifier(*loc.file), loc.line,
+    return mlir::FileLineColLoc::get(builder.getStringAttr(*loc.file), loc.line,
                                      loc.col);
   }
 

diff  --git a/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp
index 3b90fc2eee6ba..add53ce9816f8 100644
--- a/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp
@@ -93,7 +93,7 @@ class MLIRGenImpl {
 
   /// Helper conversion for a Toy AST location to an MLIR location.
   mlir::Location loc(Location loc) {
-    return mlir::FileLineColLoc::get(builder.getIdentifier(*loc.file), loc.line,
+    return mlir::FileLineColLoc::get(builder.getStringAttr(*loc.file), loc.line,
                                      loc.col);
   }
 

diff  --git a/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp
index 3b90fc2eee6ba..add53ce9816f8 100644
--- a/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp
@@ -93,7 +93,7 @@ class MLIRGenImpl {
 
   /// Helper conversion for a Toy AST location to an MLIR location.
   mlir::Location loc(Location loc) {
-    return mlir::FileLineColLoc::get(builder.getIdentifier(*loc.file), loc.line,
+    return mlir::FileLineColLoc::get(builder.getStringAttr(*loc.file), loc.line,
                                      loc.col);
   }
 

diff  --git a/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp
index 3b90fc2eee6ba..add53ce9816f8 100644
--- a/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp
@@ -93,7 +93,7 @@ class MLIRGenImpl {
 
   /// Helper conversion for a Toy AST location to an MLIR location.
   mlir::Location loc(Location loc) {
-    return mlir::FileLineColLoc::get(builder.getIdentifier(*loc.file), loc.line,
+    return mlir::FileLineColLoc::get(builder.getStringAttr(*loc.file), loc.line,
                                      loc.col);
   }
 

diff  --git a/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp
index f4e8ced97af7c..23cacb6d7c1e5 100644
--- a/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp
+++ b/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp
@@ -113,7 +113,7 @@ class MLIRGenImpl {
 
   /// Helper conversion for a Toy AST location to an MLIR location.
   mlir::Location loc(Location loc) {
-    return mlir::FileLineColLoc::get(builder.getIdentifier(*loc.file), loc.line,
+    return mlir::FileLineColLoc::get(builder.getStringAttr(*loc.file), loc.line,
                                      loc.col);
   }
 

diff  --git a/mlir/include/mlir/CAPI/IR.h b/mlir/include/mlir/CAPI/IR.h
index 7fd47504aa85b..af7ae89771f94 100644
--- a/mlir/include/mlir/CAPI/IR.h
+++ b/mlir/include/mlir/CAPI/IR.h
@@ -17,7 +17,6 @@
 
 #include "mlir/CAPI/Wrap.h"
 #include "mlir/IR/BuiltinOps.h"
-#include "mlir/IR/Identifier.h"
 #include "mlir/IR/MLIRContext.h"
 #include "mlir/IR/Operation.h"
 

diff  --git a/mlir/include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.td b/mlir/include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.td
index 29a379ca8961f..8a4c0f69de4ec 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.td
+++ b/mlir/include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.td
@@ -167,7 +167,7 @@ def AffineMapAccessInterface : OpInterface<"AffineMapAccessInterface"> {
         ConcreteOp op = cast<ConcreteOp>(this->getOperation());
         assert(memref == op.getMemRef() &&
                "Expected memref argument to match memref operand");
-        return {Identifier::get(op.getMapAttrName(), op.getContext()),
+        return {StringAttr::get(op.getContext(), op.getMapAttrName()),
                 op.getAffineMapAttr()};
       }]
     >,

diff  --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
index eaab9ca5954df..06e89113dd339 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
+++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
@@ -188,14 +188,14 @@ class AffineDmaStartOp
   /// Returns the AffineMapAttr associated with 'memref'.
   NamedAttribute getAffineMapAttrForMemRef(Value memref) {
     if (memref == getSrcMemRef())
-      return {Identifier::get(getSrcMapAttrName(), getContext()),
+      return {StringAttr::get(getContext(), getSrcMapAttrName()),
               getSrcMapAttr()};
     if (memref == getDstMemRef())
-      return {Identifier::get(getDstMapAttrName(), getContext()),
+      return {StringAttr::get(getContext(), getDstMapAttrName()),
               getDstMapAttr()};
     assert(memref == getTagMemRef() &&
            "DmaStartOp expected source, destination or tag memref");
-    return {Identifier::get(getTagMapAttrName(), getContext()),
+    return {StringAttr::get(getContext(), getTagMapAttrName()),
             getTagMapAttr()};
   }
 
@@ -303,7 +303,7 @@ class AffineDmaWaitOp
   /// associated with 'memref'.
   NamedAttribute getAffineMapAttrForMemRef(Value memref) {
     assert(memref == getTagMemRef());
-    return {Identifier::get(getTagMapAttrName(), getContext()),
+    return {StringAttr::get(getContext(), getTagMapAttrName()),
             getTagMapAttr()};
   }
 

diff  --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
index c8d3f57f72121..c04115476d35e 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
+++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
@@ -309,7 +309,7 @@ def AffineForOp : Affine_Op<"for",
     void setStep(int64_t step) {
       assert(step > 0 && "step has to be a positive integer constant");
       auto *context = getLowerBoundMap().getContext();
-      (*this)->setAttr(Identifier::get(getStepAttrName(), context),
+      (*this)->setAttr(StringAttr::get(context, getStepAttrName()),
                        IntegerAttr::get(IndexType::get(context), step));
     }
 
@@ -815,7 +815,7 @@ def AffinePrefetchOp : Affine_Op<"prefetch",
     NamedAttribute getAffineMapAttrForMemRef(Value mref) {
       assert(mref == memref() &&
              "Expected mref argument to match memref operand");
-      return {Identifier::get(getMapAttrName(), getContext()),
+      return {StringAttr::get(getContext(), getMapAttrName()),
         getAffineMapAttr()};
     }
 

diff  --git a/mlir/include/mlir/Dialect/DLTI/DLTI.h b/mlir/include/mlir/Dialect/DLTI/DLTI.h
index c80b45bbe804f..1aa9ab5e250ab 100644
--- a/mlir/include/mlir/Dialect/DLTI/DLTI.h
+++ b/mlir/include/mlir/Dialect/DLTI/DLTI.h
@@ -41,7 +41,7 @@ class DataLayoutEntryAttr
   constexpr const static llvm::StringLiteral kAttrKeyword = "dl_entry";
 
   /// Returns the entry with the given key and value.
-  static DataLayoutEntryAttr get(Identifier key, Attribute value);
+  static DataLayoutEntryAttr get(StringAttr key, Attribute value);
   static DataLayoutEntryAttr get(Type key, Attribute value);
 
   /// Returns the key of this entry.

diff  --git a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
index 6b816f9359c55..8099fe9fed517 100644
--- a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
@@ -17,7 +17,6 @@
 #include "mlir/Dialect/Utils/StaticValueUtils.h"
 #include "mlir/Dialect/Vector/VectorTransforms.h"
 #include "mlir/Dialect/X86Vector/Transforms.h"
-#include "mlir/IR/Identifier.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/Transforms/Bufferize.h"
 #include "llvm/ADT/SmallBitVector.h"
@@ -426,12 +425,12 @@ struct LinalgTransformationFilter {
   using FilterFunction = std::function<LogicalResult(Operation *)>;
 
   explicit LinalgTransformationFilter(
-      ArrayRef<Identifier> matchDisjunction = {},
-      Optional<Identifier> replacement = None);
+      ArrayRef<StringAttr> matchDisjunction = {},
+      Optional<StringAttr> replacement = None);
 
   explicit LinalgTransformationFilter(
-      FilterFunction f, ArrayRef<Identifier> matchDisjunction = {},
-      Optional<Identifier> replacement = None);
+      FilterFunction f, ArrayRef<StringAttr> matchDisjunction = {},
+      Optional<StringAttr> replacement = None);
 
   LinalgTransformationFilter(LinalgTransformationFilter &&) = default;
   LinalgTransformationFilter(const LinalgTransformationFilter &) = default;
@@ -456,8 +455,8 @@ struct LinalgTransformationFilter {
 
 private:
   SmallVector<FilterFunction> filters;
-  SmallVector<Identifier> matchDisjunction;
-  Optional<Identifier> replacement;
+  SmallVector<StringAttr> matchDisjunction;
+  Optional<StringAttr> replacement;
   /// When set to true, if the attribute is not set, it will be treated as
   /// a match. Default is false.
   bool matchByDefault;

diff  --git a/mlir/include/mlir/IR/Attributes.h b/mlir/include/mlir/IR/Attributes.h
index 74a4405abd59f..3cacd675a378e 100644
--- a/mlir/include/mlir/IR/Attributes.h
+++ b/mlir/include/mlir/IR/Attributes.h
@@ -136,10 +136,10 @@ inline ::llvm::hash_code hash_value(Attribute arg) {
 // NamedAttribute
 //===----------------------------------------------------------------------===//
 
-/// NamedAttribute is combination of a name, represented by an Identifier, and a
+/// NamedAttribute is combination of a name, represented by a StringAttr, and a
 /// value, represented by an Attribute. The attribute pointer should always be
 /// non-null.
-using NamedAttribute = std::pair<Identifier, Attribute>;
+using NamedAttribute = std::pair<StringAttr, Attribute>;
 
 bool operator<(const NamedAttribute &lhs, const NamedAttribute &rhs);
 bool operator<(const NamedAttribute &lhs, StringRef rhs);

diff  --git a/mlir/include/mlir/IR/Builders.h b/mlir/include/mlir/IR/Builders.h
index 9e26c31481050..d0e12b7a1457d 100644
--- a/mlir/include/mlir/IR/Builders.h
+++ b/mlir/include/mlir/IR/Builders.h
@@ -53,7 +53,7 @@ class Builder {
 
   MLIRContext *getContext() const { return context; }
 
-  Identifier getIdentifier(const Twine &str);
+  StringAttr getIdentifier(const Twine &str);
 
   // Locations.
   Location getUnknownLoc();

diff  --git a/mlir/include/mlir/IR/BuiltinAttributes.td b/mlir/include/mlir/IR/BuiltinAttributes.td
index a0393df7aa896..724120a88eb21 100644
--- a/mlir/include/mlir/IR/BuiltinAttributes.td
+++ b/mlir/include/mlir/IR/BuiltinAttributes.td
@@ -379,15 +379,15 @@ def Builtin_DictionaryAttr : Builtin_Attr<"Dictionary", [
 
     /// Return the specified attribute if present, null otherwise.
     Attribute get(StringRef name) const;
-    Attribute get(Identifier name) const;
+    Attribute get(StringAttr name) const;
 
     /// Return the specified named attribute if present, None otherwise.
     Optional<NamedAttribute> getNamed(StringRef name) const;
-    Optional<NamedAttribute> getNamed(Identifier name) const;
+    Optional<NamedAttribute> getNamed(StringAttr name) const;
 
     /// Return whether the specified attribute is present.
     bool contains(StringRef name) const;
-    bool contains(Identifier name) const;
+    bool contains(StringAttr name) const;
 
     /// Support range iteration.
     using iterator = llvm::ArrayRef<NamedAttribute>::iterator;
@@ -641,11 +641,11 @@ def Builtin_OpaqueAttr : Builtin_Attr<"Opaque"> {
     #dialect<"opaque attribute data">
     ```
   }];
-  let parameters = (ins "Identifier":$dialectNamespace,
+  let parameters = (ins "StringAttr":$dialectNamespace,
                         StringRefParameter<"">:$attrData,
                         AttributeSelfTypeParameter<"">:$type);
   let builders = [
-    AttrBuilderWithInferredContext<(ins "Identifier":$dialect,
+    AttrBuilderWithInferredContext<(ins "StringAttr":$dialect,
                                         "StringRef":$attrData,
                                         "Type":$type), [{
       return $_get(dialect.getContext(), dialect, attrData, type);
@@ -688,11 +688,11 @@ def Builtin_OpaqueElementsAttr : Builtin_Attr<
 
   // TODO: Provide a way to avoid copying content of large opaque
   // tensors This will likely require a new reference attribute kind.
-  let parameters = (ins "Identifier":$dialect,
+  let parameters = (ins "StringAttr":$dialect,
                         StringRefParameter<"">:$value,
                         AttributeSelfTypeParameter<"", "ShapedType">:$type);
   let builders = [
-    AttrBuilderWithInferredContext<(ins "Identifier":$dialect,
+    AttrBuilderWithInferredContext<(ins "StringAttr":$dialect,
                                         "ShapedType":$type,
                                         "StringRef":$value), [{
       return $_get(dialect.getContext(), dialect, value, type);
@@ -701,7 +701,7 @@ def Builtin_OpaqueElementsAttr : Builtin_Attr<
                                         "ShapedType":$type,
                                         "StringRef":$value), [{
       MLIRContext *ctxt = dialect->getContext();
-      Identifier dialectName = Identifier::get(dialect->getNamespace(), ctxt);
+      StringAttr dialectName = StringAttr::get(ctxt, dialect->getNamespace());
       return $_get(ctxt, dialectName, value, type);
     }]>
   ];

diff  --git a/mlir/include/mlir/IR/BuiltinLocationAttributes.td b/mlir/include/mlir/IR/BuiltinLocationAttributes.td
index 3858b11e05215..535016b9912ad 100644
--- a/mlir/include/mlir/IR/BuiltinLocationAttributes.td
+++ b/mlir/include/mlir/IR/BuiltinLocationAttributes.td
@@ -81,10 +81,10 @@ def FileLineColLoc : Builtin_LocationAttr<"FileLineColLoc"> {
     loc("mysource.cc":10:8)
     ```
   }];
-  let parameters = (ins "Identifier":$filename, "unsigned":$line,
+  let parameters = (ins "StringAttr":$filename, "unsigned":$line,
                         "unsigned":$column);
   let builders = [
-    AttrBuilderWithInferredContext<(ins "Identifier":$filename,
+    AttrBuilderWithInferredContext<(ins "StringAttr":$filename,
                                         "unsigned":$line,
                                         "unsigned":$column), [{
       return $_get(filename.getContext(), filename, line, column);
@@ -92,7 +92,7 @@ def FileLineColLoc : Builtin_LocationAttr<"FileLineColLoc"> {
     AttrBuilder<(ins "StringRef":$filename, "unsigned":$line,
                      "unsigned":$column), [{
       return $_get($_ctxt,
-                   Identifier::get(filename.empty() ? "-" : filename, $_ctxt),
+                   StringAttr::get($_ctxt, filename.empty() ? "-" : filename),
                    line, column);
     }]>
   ];
@@ -161,13 +161,13 @@ def NameLoc : Builtin_LocationAttr<"NameLoc"> {
     loc("CSE"("mysource.cc":10:8))
     ```
   }];
-  let parameters = (ins "Identifier":$name, "Location":$childLoc);
+  let parameters = (ins "StringAttr":$name, "Location":$childLoc);
   let builders = [
-    AttrBuilderWithInferredContext<(ins "Identifier":$name,
+    AttrBuilderWithInferredContext<(ins "StringAttr":$name,
                                         "Location":$childLoc), [{
       return $_get(name.getContext(), name, childLoc);
     }]>,
-    AttrBuilderWithInferredContext<(ins "Identifier":$name), [{
+    AttrBuilderWithInferredContext<(ins "StringAttr":$name), [{
       return $_get(name.getContext(), name,
                    UnknownLoc::get(name.getContext()));
     }]>

diff  --git a/mlir/include/mlir/IR/BuiltinTypes.h b/mlir/include/mlir/IR/BuiltinTypes.h
index 82cc5840f867f..b4ce23a72915c 100644
--- a/mlir/include/mlir/IR/BuiltinTypes.h
+++ b/mlir/include/mlir/IR/BuiltinTypes.h
@@ -25,9 +25,6 @@ class IntegerType;
 class StringAttr;
 class TypeRange;
 
-// TODO: Remove this when all usages have been replaced with StringAttr.
-using Identifier = StringAttr;
-
 //===----------------------------------------------------------------------===//
 // FloatType
 //===----------------------------------------------------------------------===//

diff  --git a/mlir/include/mlir/IR/BuiltinTypes.td b/mlir/include/mlir/IR/BuiltinTypes.td
index c38a9c4cbe159..41577193c7787 100644
--- a/mlir/include/mlir/IR/BuiltinTypes.td
+++ b/mlir/include/mlir/IR/BuiltinTypes.td
@@ -600,13 +600,13 @@ def Builtin_Opaque : Builtin_Type<"Opaque"> {
     ```
   }];
   let parameters = (ins
-    "Identifier":$dialectNamespace,
+    "StringAttr":$dialectNamespace,
     StringRefParameter<"">:$typeData
   );
 
   let builders = [
     TypeBuilderWithInferredContext<(ins
-      "Identifier":$dialectNamespace, CArg<"StringRef", "{}">:$typeData
+      "StringAttr":$dialectNamespace, CArg<"StringRef", "{}">:$typeData
     ), [{
       return $_get(dialectNamespace.getContext(), dialectNamespace, typeData);
     }]>

diff  --git a/mlir/include/mlir/IR/FunctionSupport.h b/mlir/include/mlir/IR/FunctionSupport.h
index 51a3f9d582bf4..3add909d742e7 100644
--- a/mlir/include/mlir/IR/FunctionSupport.h
+++ b/mlir/include/mlir/IR/FunctionSupport.h
@@ -396,7 +396,7 @@ class FunctionLike : public OpTrait::TraitBase<ConcreteType, FunctionLike> {
 
   /// Return the specified attribute, if present, for the argument at 'index',
   /// null otherwise.
-  Attribute getArgAttr(unsigned index, Identifier name) {
+  Attribute getArgAttr(unsigned index, StringAttr name) {
     auto argDict = getArgAttrDict(index);
     return argDict ? argDict.get(name) : nullptr;
   }
@@ -406,7 +406,7 @@ class FunctionLike : public OpTrait::TraitBase<ConcreteType, FunctionLike> {
   }
 
   template <typename AttrClass>
-  AttrClass getArgAttrOfType(unsigned index, Identifier name) {
+  AttrClass getArgAttrOfType(unsigned index, StringAttr name) {
     return getArgAttr(index, name).template dyn_cast_or_null<AttrClass>();
   }
   template <typename AttrClass>
@@ -436,19 +436,19 @@ class FunctionLike : public OpTrait::TraitBase<ConcreteType, FunctionLike> {
 
   /// If the an attribute exists with the specified name, change it to the new
   /// value. Otherwise, add a new attribute with the specified name/value.
-  void setArgAttr(unsigned index, Identifier name, Attribute value);
+  void setArgAttr(unsigned index, StringAttr name, Attribute value);
   void setArgAttr(unsigned index, StringRef name, Attribute value) {
-    setArgAttr(index, Identifier::get(name, this->getOperation()->getContext()),
+    setArgAttr(index, StringAttr::get(this->getOperation()->getContext(), name),
                value);
   }
 
   /// Remove the attribute 'name' from the argument at 'index'. Return the
   /// attribute that was erased, or nullptr if there was no attribute with such
   /// name.
-  Attribute removeArgAttr(unsigned index, Identifier name);
+  Attribute removeArgAttr(unsigned index, StringAttr name);
   Attribute removeArgAttr(unsigned index, StringRef name) {
     return removeArgAttr(
-        index, Identifier::get(name, this->getOperation()->getContext()));
+        index, StringAttr::get(this->getOperation()->getContext(), name));
   }
 
   //===--------------------------------------------------------------------===//
@@ -485,7 +485,7 @@ class FunctionLike : public OpTrait::TraitBase<ConcreteType, FunctionLike> {
 
   /// Return the specified attribute, if present, for the result at 'index',
   /// null otherwise.
-  Attribute getResultAttr(unsigned index, Identifier name) {
+  Attribute getResultAttr(unsigned index, StringAttr name) {
     auto argDict = getResultAttrDict(index);
     return argDict ? argDict.get(name) : nullptr;
   }
@@ -495,7 +495,7 @@ class FunctionLike : public OpTrait::TraitBase<ConcreteType, FunctionLike> {
   }
 
   template <typename AttrClass>
-  AttrClass getResultAttrOfType(unsigned index, Identifier name) {
+  AttrClass getResultAttrOfType(unsigned index, StringAttr name) {
     return getResultAttr(index, name).template dyn_cast_or_null<AttrClass>();
   }
   template <typename AttrClass>
@@ -525,17 +525,17 @@ class FunctionLike : public OpTrait::TraitBase<ConcreteType, FunctionLike> {
 
   /// If the an attribute exists with the specified name, change it to the new
   /// value. Otherwise, add a new attribute with the specified name/value.
-  void setResultAttr(unsigned index, Identifier name, Attribute value);
+  void setResultAttr(unsigned index, StringAttr name, Attribute value);
   void setResultAttr(unsigned index, StringRef name, Attribute value) {
     setResultAttr(index,
-                  Identifier::get(name, this->getOperation()->getContext()),
+                  StringAttr::get(this->getOperation()->getContext(), name),
                   value);
   }
 
   /// Remove the attribute 'name' from the result at 'index'. Return the
   /// attribute that was erased, or nullptr if there was no attribute with such
   /// name.
-  Attribute removeResultAttr(unsigned index, Identifier name);
+  Attribute removeResultAttr(unsigned index, StringAttr name);
 
 protected:
   /// Returns the dictionary attribute corresponding to the argument at 'index'.
@@ -718,7 +718,7 @@ void FunctionLike<ConcreteType>::setArgAttrs(unsigned index,
 /// If the an attribute exists with the specified name, change it to the new
 /// value. Otherwise, add a new attribute with the specified name/value.
 template <typename ConcreteType>
-void FunctionLike<ConcreteType>::setArgAttr(unsigned index, Identifier name,
+void FunctionLike<ConcreteType>::setArgAttr(unsigned index, StringAttr name,
                                             Attribute value) {
   NamedAttrList attributes(getArgAttrDict(index));
   Attribute oldValue = attributes.set(name, value);
@@ -731,7 +731,7 @@ void FunctionLike<ConcreteType>::setArgAttr(unsigned index, Identifier name,
 /// Remove the attribute 'name' from the argument at 'index'.
 template <typename ConcreteType>
 Attribute FunctionLike<ConcreteType>::removeArgAttr(unsigned index,
-                                                    Identifier name) {
+                                                    StringAttr name) {
   // Build an attribute list and remove the attribute at 'name'.
   NamedAttrList attributes(getArgAttrDict(index));
   Attribute removedAttr = attributes.erase(name);
@@ -770,7 +770,7 @@ void FunctionLike<ConcreteType>::setResultAttrs(unsigned index,
 /// If the an attribute exists with the specified name, change it to the new
 /// value. Otherwise, add a new attribute with the specified name/value.
 template <typename ConcreteType>
-void FunctionLike<ConcreteType>::setResultAttr(unsigned index, Identifier name,
+void FunctionLike<ConcreteType>::setResultAttr(unsigned index, StringAttr name,
                                                Attribute value) {
   NamedAttrList attributes(getResultAttrDict(index));
   Attribute oldAttr = attributes.set(name, value);
@@ -783,7 +783,7 @@ void FunctionLike<ConcreteType>::setResultAttr(unsigned index, Identifier name,
 /// Remove the attribute 'name' from the result at 'index'.
 template <typename ConcreteType>
 Attribute FunctionLike<ConcreteType>::removeResultAttr(unsigned index,
-                                                       Identifier name) {
+                                                       StringAttr name) {
   // Build an attribute list and remove the attribute at 'name'.
   NamedAttrList attributes(getResultAttrDict(index));
   Attribute removedAttr = attributes.erase(name);

diff  --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td
index b234dbee8a119..1398bd7aac3c6 100644
--- a/mlir/include/mlir/IR/OpBase.td
+++ b/mlir/include/mlir/IR/OpBase.td
@@ -549,7 +549,7 @@ class OpaqueType<string dialect, string name, string summary>
   : Type<CPred<"isOpaqueTypeWithName($_self, \""#dialect#"\", \""#name#"\")">,
          summary, "::mlir::OpaqueType">,
     BuildableType<"::mlir::OpaqueType::get("
-                  "$_builder.getIdentifier(\"" # dialect # "\"), \""
+                  "$_builder.getStringAttr(\"" # dialect # "\"), \""
                   # name # "\")">;
 
 // Function Type

diff  --git a/mlir/include/mlir/IR/Operation.h b/mlir/include/mlir/IR/Operation.h
index 15f8e6b061468..112284a8f10dc 100644
--- a/mlir/include/mlir/IR/Operation.h
+++ b/mlir/include/mlir/IR/Operation.h
@@ -320,19 +320,21 @@ class alignas(8) Operation final
   }
 
   /// Return the specified attribute if present, null otherwise.
-  Attribute getAttr(Identifier name) { return attrs.get(name); }
+  Attribute getAttr(StringAttr name) { return attrs.get(name); }
   Attribute getAttr(StringRef name) { return attrs.get(name); }
 
-  template <typename AttrClass> AttrClass getAttrOfType(Identifier name) {
+  template <typename AttrClass>
+  AttrClass getAttrOfType(StringAttr name) {
     return getAttr(name).dyn_cast_or_null<AttrClass>();
   }
-  template <typename AttrClass> AttrClass getAttrOfType(StringRef name) {
+  template <typename AttrClass>
+  AttrClass getAttrOfType(StringRef name) {
     return getAttr(name).dyn_cast_or_null<AttrClass>();
   }
 
   /// Return true if the operation has an attribute with the provided name,
   /// false otherwise.
-  bool hasAttr(Identifier name) { return attrs.contains(name); }
+  bool hasAttr(StringAttr name) { return attrs.contains(name); }
   bool hasAttr(StringRef name) { return attrs.contains(name); }
   template <typename AttrClass, typename NameT>
   bool hasAttrOfType(NameT &&name) {
@@ -342,19 +344,19 @@ class alignas(8) Operation final
 
   /// If the an attribute exists with the specified name, change it to the new
   /// value. Otherwise, add a new attribute with the specified name/value.
-  void setAttr(Identifier name, Attribute value) {
+  void setAttr(StringAttr name, Attribute value) {
     NamedAttrList attributes(attrs);
     if (attributes.set(name, value) != value)
       attrs = attributes.getDictionary(getContext());
   }
   void setAttr(StringRef name, Attribute value) {
-    setAttr(Identifier::get(name, getContext()), value);
+    setAttr(StringAttr::get(getContext(), name), value);
   }
 
   /// Remove the attribute with the specified name if it exists. Return the
   /// attribute that was erased, or nullptr if there was no attribute with such
   /// name.
-  Attribute removeAttr(Identifier name) {
+  Attribute removeAttr(StringAttr name) {
     NamedAttrList attributes(attrs);
     Attribute removedAttr = attributes.erase(name);
     if (removedAttr)
@@ -362,7 +364,7 @@ class alignas(8) Operation final
     return removedAttr;
   }
   Attribute removeAttr(StringRef name) {
-    return removeAttr(Identifier::get(name, getContext()));
+    return removeAttr(StringAttr::get(getContext(), name));
   }
 
   /// A utility iterator that filters out non-dialect attributes.

diff  --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h
index 887306fbc545c..a18d2afbd7b4a 100644
--- a/mlir/include/mlir/IR/OperationSupport.h
+++ b/mlir/include/mlir/IR/OperationSupport.h
@@ -14,9 +14,8 @@
 #ifndef MLIR_IR_OPERATION_SUPPORT_H
 #define MLIR_IR_OPERATION_SUPPORT_H
 
-#include "mlir/IR/Attributes.h"
 #include "mlir/IR/BlockSupport.h"
-#include "mlir/IR/Identifier.h"
+#include "mlir/IR/BuiltinAttributes.h"
 #include "mlir/IR/Location.h"
 #include "mlir/IR/TypeRange.h"
 #include "mlir/IR/Types.h"
@@ -82,7 +81,7 @@ class AbstractOperation {
       llvm::unique_function<LogicalResult(Operation *) const>;
 
   /// This is the name of the operation.
-  const Identifier name;
+  const StringAttr name;
 
   /// This is the dialect that this operation belongs to.
   Dialect &dialect;
@@ -207,7 +206,7 @@ class AbstractOperation {
   /// greatly simplifying the cost and complexity of attribute usage produced by
   /// the generator.
   ///
-  ArrayRef<Identifier> getAttributeNames() const { return attributeNames; }
+  ArrayRef<StringAttr> getAttributeNames() const { return attributeNames; }
 
 private:
   AbstractOperation(StringRef name, Dialect &dialect, TypeID typeID,
@@ -217,7 +216,7 @@ class AbstractOperation {
                     FoldHookFn &&foldHook,
                     GetCanonicalizationPatternsFn &&getCanonicalizationPatterns,
                     detail::InterfaceMap &&interfaceMap, HasTraitFn &&hasTrait,
-                    ArrayRef<Identifier> attrNames);
+                    ArrayRef<StringAttr> attrNames);
 
   /// Give Op access to lookupMutable.
   template <typename ConcreteType, template <typename T> class... Traits>
@@ -242,7 +241,7 @@ class AbstractOperation {
   /// A list of attribute names registered to this operation in identifier form.
   /// This allows for operation classes to use identifiers for attribute
   /// lookup/creation/etc., as opposed to strings.
-  ArrayRef<Identifier> attributeNames;
+  ArrayRef<StringAttr> attributeNames;
 };
 
 //===----------------------------------------------------------------------===//
@@ -288,12 +287,12 @@ std::pair<IteratorT, bool> findAttrSorted(IteratorT first, IteratorT last,
   return {first, false};
 }
 
-/// Identifier lookups on large attribute lists will switch to string binary
+/// StringAttr lookups on large attribute lists will switch to string binary
 /// search. String binary searches become significantly faster than linear scans
 /// with the identifier when the attribute list becomes very large.
 template <typename IteratorT>
 std::pair<IteratorT, bool> findAttrSorted(IteratorT first, IteratorT last,
-                                          Identifier name) {
+                                          StringAttr name) {
   constexpr unsigned kSmallAttributeList = 16;
   if (std::distance(first, last) > kSmallAttributeList)
     return findAttrSorted(first, last, name.strref());
@@ -332,7 +331,7 @@ class NamedAttrList {
   void append(StringRef name, Attribute attr);
 
   /// Add an attribute with the specified name.
-  void append(Identifier name, Attribute attr) {
+  void append(StringAttr name, Attribute attr) {
     append(NamedAttribute(name, attr));
   }
 
@@ -384,24 +383,24 @@ class NamedAttrList {
   ArrayRef<NamedAttribute> getAttrs() const;
 
   /// Return the specified attribute if present, null otherwise.
-  Attribute get(Identifier name) const;
+  Attribute get(StringAttr name) const;
   Attribute get(StringRef name) const;
 
   /// Return the specified named attribute if present, None otherwise.
   Optional<NamedAttribute> getNamed(StringRef name) const;
-  Optional<NamedAttribute> getNamed(Identifier name) const;
+  Optional<NamedAttribute> getNamed(StringAttr name) const;
 
   /// If the an attribute exists with the specified name, change it to the new
   /// value. Otherwise, add a new attribute with the specified name/value.
   /// Returns the previous attribute value of `name`, or null if no
   /// attribute previously existed with `name`.
-  Attribute set(Identifier name, Attribute value);
+  Attribute set(StringAttr name, Attribute value);
   Attribute set(StringRef name, Attribute value);
 
   /// Erase the attribute with the given name from the list. Return the
   /// attribute that was erased, or nullptr if there was no attribute with such
   /// name.
-  Attribute erase(Identifier name);
+  Attribute erase(StringAttr name);
   Attribute erase(StringRef name);
 
   iterator begin() { return attrs.begin(); }
@@ -443,7 +442,7 @@ class NamedAttrList {
 class OperationName {
 public:
   using RepresentationUnion =
-      PointerUnion<Identifier, const AbstractOperation *>;
+      PointerUnion<StringAttr, const AbstractOperation *>;
 
   OperationName(AbstractOperation *op) : representation(op) {}
   OperationName(StringRef name, MLIRContext *context);
@@ -456,7 +455,7 @@ class OperationName {
   Dialect *getDialect() const {
     if (const auto *abstractOp = getAbstractOperation())
       return &abstractOp->dialect;
-    return representation.get<Identifier>().getReferencedDialect();
+    return representation.get<StringAttr>().getReferencedDialect();
   }
 
   /// Return the operation name with dialect name stripped, if it has one.
@@ -466,7 +465,7 @@ class OperationName {
   StringRef getStringRef() const;
 
   /// Return the name of this operation as an identifier. This always succeeds.
-  Identifier getIdentifier() const;
+  StringAttr getIdentifier() const;
 
   /// If this operation has a registered operation description, return it.
   /// Otherwise return null.
@@ -549,11 +548,11 @@ struct OperationState {
 
   /// Add an attribute with the specified name.
   void addAttribute(StringRef name, Attribute attr) {
-    addAttribute(Identifier::get(name, getContext()), attr);
+    addAttribute(StringAttr::get(getContext(), name), attr);
   }
 
   /// Add an attribute with the specified name.
-  void addAttribute(Identifier name, Attribute attr) {
+  void addAttribute(StringAttr name, Attribute attr) {
     attributes.append(name, attr);
   }
 

diff  --git a/mlir/include/mlir/Interfaces/DataLayoutInterfaces.h b/mlir/include/mlir/Interfaces/DataLayoutInterfaces.h
index 84fee54086539..6d214ed30236b 100644
--- a/mlir/include/mlir/Interfaces/DataLayoutInterfaces.h
+++ b/mlir/include/mlir/Interfaces/DataLayoutInterfaces.h
@@ -22,7 +22,7 @@
 namespace mlir {
 class DataLayout;
 class DataLayoutEntryInterface;
-using DataLayoutEntryKey = llvm::PointerUnion<Type, Identifier>;
+using DataLayoutEntryKey = llvm::PointerUnion<Type, StringAttr>;
 // Using explicit SmallVector size because we cannot infer the size from the
 // forward declaration, and we need the typedef in the actual declaration.
 using DataLayoutEntryList = llvm::SmallVector<DataLayoutEntryInterface, 4>;
@@ -65,7 +65,7 @@ DataLayoutEntryList filterEntriesForType(DataLayoutEntryListRef entries,
 /// Given a list of data layout entries, returns the entry that has the given
 /// identifier as key, if such an entry exists in the list.
 DataLayoutEntryInterface
-filterEntryForIdentifier(DataLayoutEntryListRef entries, Identifier id);
+filterEntryForIdentifier(DataLayoutEntryListRef entries, StringAttr id);
 
 /// Verifies that the operation implementing the data layout interface, or a
 /// module operation, is valid. This calls the verifier of the spec attribute

diff  --git a/mlir/include/mlir/Interfaces/DataLayoutInterfaces.td b/mlir/include/mlir/Interfaces/DataLayoutInterfaces.td
index fc3d6a8c803ee..0ca0f9e22191e 100644
--- a/mlir/include/mlir/Interfaces/DataLayoutInterfaces.td
+++ b/mlir/include/mlir/Interfaces/DataLayoutInterfaces.td
@@ -126,7 +126,7 @@ def DataLayoutSpecInterface : AttrInterface<"DataLayoutSpecInterface"> {
                       "present.",
       /*retTy=*/"::mlir::DataLayoutEntryInterface",
       /*methodName=*/"getSpecForIdentifier",
-      /*args=*/(ins "::mlir::Identifier":$identifier),
+      /*args=*/(ins "::mlir::StringAttr":$identifier),
       /*methodBody=*/"",
       /*defaultImplementation=*/[{
         return ::mlir::detail::filterEntryForIdentifier($_attr.getEntries(),
@@ -159,7 +159,7 @@ def DataLayoutSpecInterface : AttrInterface<"DataLayoutSpecInterface"> {
     /// method directly.
     void bucketEntriesByType(
         ::llvm::DenseMap<::mlir::TypeID, ::mlir::DataLayoutEntryList> &types,
-        ::llvm::DenseMap<::mlir::Identifier,
+        ::llvm::DenseMap<::mlir::StringAttr,
                          ::mlir::DataLayoutEntryInterface> &ids);
   }];
 }

diff  --git a/mlir/include/mlir/Pass/PassInstrumentation.h b/mlir/include/mlir/Pass/PassInstrumentation.h
index baf230f086fd1..88c8516343d0a 100644
--- a/mlir/include/mlir/Pass/PassInstrumentation.h
+++ b/mlir/include/mlir/Pass/PassInstrumentation.h
@@ -9,7 +9,7 @@
 #ifndef MLIR_PASS_PASSINSTRUMENTATION_H_
 #define MLIR_PASS_PASSINSTRUMENTATION_H_
 
-#include "mlir/IR/Identifier.h"
+#include "mlir/IR/BuiltinAttributes.h"
 #include "mlir/Support/LLVM.h"
 #include "mlir/Support/TypeID.h"
 
@@ -43,13 +43,13 @@ class PassInstrumentation {
   /// A callback to run before a pass pipeline is executed. This function takes
   /// the name of the operation type being operated on, and information related
   /// to the parent that spawned this pipeline.
-  virtual void runBeforePipeline(Identifier name,
+  virtual void runBeforePipeline(StringAttr name,
                                  const PipelineParentInfo &parentInfo) {}
 
   /// A callback to run after a pass pipeline has executed. This function takes
   /// the name of the operation type being operated on, and information related
   /// to the parent that spawned this pipeline.
-  virtual void runAfterPipeline(Identifier name,
+  virtual void runAfterPipeline(StringAttr name,
                                 const PipelineParentInfo &parentInfo) {}
 
   /// A callback to run before a pass is executed. This function takes a pointer
@@ -90,12 +90,12 @@ class PassInstrumentor {
 
   /// See PassInstrumentation::runBeforePipeline for details.
   void
-  runBeforePipeline(Identifier name,
+  runBeforePipeline(StringAttr name,
                     const PassInstrumentation::PipelineParentInfo &parentInfo);
 
   /// See PassInstrumentation::runAfterPipeline for details.
   void
-  runAfterPipeline(Identifier name,
+  runAfterPipeline(StringAttr name,
                    const PassInstrumentation::PipelineParentInfo &parentInfo);
 
   /// See PassInstrumentation::runBeforePass for details.

diff  --git a/mlir/include/mlir/Pass/PassManager.h b/mlir/include/mlir/Pass/PassManager.h
index 9e68b9086368d..08468882d8576 100644
--- a/mlir/include/mlir/Pass/PassManager.h
+++ b/mlir/include/mlir/Pass/PassManager.h
@@ -34,9 +34,6 @@ class PassInstrumentation;
 class PassInstrumentor;
 class StringAttr;
 
-// TODO: Remove this when all usages have been replaced with StringAttr.
-using Identifier = StringAttr;
-
 namespace detail {
 struct OpPassManagerImpl;
 class OpToOpPassAdaptor;
@@ -54,7 +51,7 @@ struct PassExecutionState;
 class OpPassManager {
 public:
   enum class Nesting { Implicit, Explicit };
-  OpPassManager(Identifier name, Nesting nesting = Nesting::Explicit);
+  OpPassManager(StringAttr name, Nesting nesting = Nesting::Explicit);
   OpPassManager(StringRef name, Nesting nesting = Nesting::Explicit);
   OpPassManager(OpPassManager &&rhs);
   OpPassManager(const OpPassManager &rhs);
@@ -78,7 +75,7 @@ class OpPassManager {
 
   /// Nest a new operation pass manager for the given operation kind under this
   /// pass manager.
-  OpPassManager &nest(Identifier nestedName);
+  OpPassManager &nest(StringAttr nestedName);
   OpPassManager &nest(StringRef nestedName);
   template <typename OpT> OpPassManager &nest() {
     return nest(OpT::getOperationName());
@@ -101,7 +98,7 @@ class OpPassManager {
   size_t size() const;
 
   /// Return the operation name that this pass manager operates on.
-  Identifier getOpName(MLIRContext &context) const;
+  StringAttr getOpName(MLIRContext &context) const;
 
   /// Return the operation name that this pass manager operates on.
   StringRef getOpName() const;

diff  --git a/mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h b/mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h
index beabfa41d3269..875c79903b1fd 100644
--- a/mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h
+++ b/mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h
@@ -13,9 +13,8 @@
 #ifndef MLIR_TARGET_LLVMIR_LLVMTRANSLATIONINTERFACE_H
 #define MLIR_TARGET_LLVMIR_LLVMTRANSLATIONINTERFACE_H
 
-#include "mlir/IR/Attributes.h"
+#include "mlir/IR/BuiltinAttributes.h"
 #include "mlir/IR/DialectInterface.h"
-#include "mlir/IR/Identifier.h"
 #include "mlir/Support/LogicalResult.h"
 
 namespace llvm {

diff  --git a/mlir/lib/CAPI/IR/BuiltinAttributes.cpp b/mlir/lib/CAPI/IR/BuiltinAttributes.cpp
index 7ce4283600c8f..5ec7e34688dc1 100644
--- a/mlir/lib/CAPI/IR/BuiltinAttributes.cpp
+++ b/mlir/lib/CAPI/IR/BuiltinAttributes.cpp
@@ -165,7 +165,7 @@ MlirAttribute mlirOpaqueAttrGet(MlirContext ctx, MlirStringRef dialectNamespace,
                                 intptr_t dataLength, const char *data,
                                 MlirType type) {
   return wrap(
-      OpaqueAttr::get(Identifier::get(unwrap(dialectNamespace), unwrap(ctx)),
+      OpaqueAttr::get(StringAttr::get(unwrap(ctx), unwrap(dialectNamespace)),
                       StringRef(data, dataLength), unwrap(type)));
 }
 

diff  --git a/mlir/lib/CAPI/IR/IR.cpp b/mlir/lib/CAPI/IR/IR.cpp
index 7bbbc4a1d24a0..a339aef90455a 100644
--- a/mlir/lib/CAPI/IR/IR.cpp
+++ b/mlir/lib/CAPI/IR/IR.cpp
@@ -145,9 +145,9 @@ MlirLocation mlirLocationNameGet(MlirContext context, MlirStringRef name,
                                  MlirLocation childLoc) {
   if (mlirLocationIsNull(childLoc))
     return wrap(
-        Location(NameLoc::get(Identifier::get(unwrap(name), unwrap(context)))));
+        Location(NameLoc::get(StringAttr::get(unwrap(context), unwrap(name)))));
   return wrap(Location(NameLoc::get(
-      Identifier::get(unwrap(name), unwrap(context)), unwrap(childLoc))));
+      StringAttr::get(unwrap(context), unwrap(name)), unwrap(childLoc))));
 }
 
 MlirLocation mlirLocationUnknownGet(MlirContext context) {
@@ -753,7 +753,7 @@ MlirNamedAttribute mlirNamedAttributeGet(MlirIdentifier name,
 //===----------------------------------------------------------------------===//
 
 MlirIdentifier mlirIdentifierGet(MlirContext context, MlirStringRef str) {
-  return wrap(Identifier::get(unwrap(str), unwrap(context)));
+  return wrap(StringAttr::get(unwrap(context), unwrap(str)));
 }
 
 MlirContext mlirIdentifierGetContext(MlirIdentifier ident) {

diff  --git a/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h b/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h
index 72805dcb8191b..4abafb9686922 100644
--- a/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h
+++ b/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h
@@ -16,7 +16,7 @@ namespace mlir {
 
 struct GPUFuncOpLowering : ConvertOpToLLVMPattern<gpu::GPUFuncOp> {
   GPUFuncOpLowering(LLVMTypeConverter &converter, unsigned allocaAddrSpace,
-                    Identifier kernelAttributeName)
+                    StringAttr kernelAttributeName)
       : ConvertOpToLLVMPattern<gpu::GPUFuncOp>(converter),
         allocaAddrSpace(allocaAddrSpace),
         kernelAttributeName(kernelAttributeName) {}
@@ -30,7 +30,7 @@ struct GPUFuncOpLowering : ConvertOpToLLVMPattern<gpu::GPUFuncOp> {
   unsigned allocaAddrSpace;
 
   /// The attribute name to use instead of `gpu.kernel`.
-  Identifier kernelAttributeName;
+  StringAttr kernelAttributeName;
 };
 
 struct GPUReturnOpLowering : public ConvertOpToLLVMPattern<gpu::ReturnOp> {

diff  --git a/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp b/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
index d0589f1fc35bb..5cec21ec328fa 100644
--- a/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
+++ b/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
@@ -192,8 +192,8 @@ void mlir::populateGpuToNVVMConversionPatterns(LLVMTypeConverter &converter,
   // memory space and does not support `alloca`s with addrspace(5).
   patterns.add<GPUFuncOpLowering>(
       converter, /*allocaAddrSpace=*/0,
-      Identifier::get(NVVM::NVVMDialect::getKernelFuncAttrName(),
-                      &converter.getContext()));
+      StringAttr::get(&converter.getContext(),
+                      NVVM::NVVMDialect::getKernelFuncAttrName()));
 
   patterns.add<OpToFuncCallLowering<math::AbsOp>>(converter, "__nv_fabsf",
                                                   "__nv_fabs");

diff  --git a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
index 6232cc12bc1df..b074e41563315 100644
--- a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
+++ b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
@@ -117,8 +117,8 @@ void mlir::populateGpuToROCDLConversionPatterns(LLVMTypeConverter &converter,
            GPUReturnOpLowering>(converter);
   patterns.add<GPUFuncOpLowering>(
       converter, /*allocaAddrSpace=*/5,
-      Identifier::get(ROCDL::ROCDLDialect::getKernelFuncAttrName(),
-                      &converter.getContext()));
+      StringAttr::get(&converter.getContext(),
+                      ROCDL::ROCDLDialect::getKernelFuncAttrName()));
   patterns.add<OpToFuncCallLowering<math::AbsOp>>(converter, "__ocml_fabs_f32",
                                                   "__ocml_fabs_f64");
   patterns.add<OpToFuncCallLowering<math::AtanOp>>(converter, "__ocml_atan_f32",

diff  --git a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
index d55deb5ce84ac..fd047b2a43e07 100644
--- a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
+++ b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
@@ -296,8 +296,8 @@ LogicalResult GPUFuncOpConversion::matchAndRewrite(
       funcOp, *getTypeConverter(), rewriter, entryPointAttr, argABI);
   if (!newFuncOp)
     return failure();
-  newFuncOp->removeAttr(Identifier::get(
-      gpu::GPUDialect::getKernelFuncAttrName(), rewriter.getContext()));
+  newFuncOp->removeAttr(
+      rewriter.getStringAttr(gpu::GPUDialect::getKernelFuncAttrName()));
   return success();
 }
 

diff  --git a/mlir/lib/Conversion/PDLToPDLInterp/Predicate.h b/mlir/lib/Conversion/PDLToPDLInterp/Predicate.h
index 1c8fece05e071..e943d55639a58 100644
--- a/mlir/lib/Conversion/PDLToPDLInterp/Predicate.h
+++ b/mlir/lib/Conversion/PDLToPDLInterp/Predicate.h
@@ -164,12 +164,12 @@ class Position : public StorageUniquer::BaseStorage {
 /// A position describing an attribute of an operation.
 struct AttributePosition
     : public PredicateBase<AttributePosition, Position,
-                           std::pair<OperationPosition *, Identifier>,
+                           std::pair<OperationPosition *, StringAttr>,
                            Predicates::AttributePos> {
   explicit AttributePosition(const KeyTy &key);
 
   /// Returns the attribute name of this position.
-  Identifier getName() const { return key.second; }
+  StringAttr getName() const { return key.second; }
 };
 
 //===----------------------------------------------------------------------===//
@@ -487,7 +487,7 @@ class PredicateBuilder {
 
   /// Returns an attribute position for an attribute of the given operation.
   Position *getAttribute(OperationPosition *p, StringRef name) {
-    return AttributePosition::get(uniquer, p, Identifier::get(name, ctx));
+    return AttributePosition::get(uniquer, p, StringAttr::get(ctx, name));
   }
 
   /// Returns an operand position for an operand of the given operation.

diff  --git a/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp b/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp
index cc1e89f93dc22..0861ec093517e 100644
--- a/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp
@@ -35,7 +35,7 @@ struct SimplifyAffineStructures
   /// Utility to simplify an affine attribute and update its entry in the parent
   /// operation if necessary.
   template <typename AttributeT>
-  void simplifyAndUpdateAttribute(Operation *op, Identifier name,
+  void simplifyAndUpdateAttribute(Operation *op, StringAttr name,
                                   AttributeT attr) {
     auto &simplified = simplifiedAttributes[attr];
     if (simplified == attr)

diff  --git a/mlir/lib/Dialect/Affine/Utils/Utils.cpp b/mlir/lib/Dialect/Affine/Utils/Utils.cpp
index cbbc0c670e028..3f26687b17356 100644
--- a/mlir/lib/Dialect/Affine/Utils/Utils.cpp
+++ b/mlir/lib/Dialect/Affine/Utils/Utils.cpp
@@ -88,7 +88,7 @@ static AffineIfOp hoistAffineIfOp(AffineIfOp ifOp, Operation *hoistOverOp) {
   Operation *hoistOverOpClone = nullptr;
   // We use this unique name to identify/find  `ifOp`'s clone in the else
   // version.
-  Identifier idForIfOp = b.getIdentifier("__mlir_if_hoisting");
+  StringAttr idForIfOp = b.getStringAttr("__mlir_if_hoisting");
   operandMap.clear();
   b.setInsertionPointAfter(hoistOverOp);
   // We'll set an attribute to identify this op in a clone of this sub-tree.

diff  --git a/mlir/lib/Dialect/DLTI/DLTI.cpp b/mlir/lib/Dialect/DLTI/DLTI.cpp
index b18f3db600228..86ad28b2823d2 100644
--- a/mlir/lib/Dialect/DLTI/DLTI.cpp
+++ b/mlir/lib/Dialect/DLTI/DLTI.cpp
@@ -49,7 +49,7 @@ class DataLayoutEntryStorage : public AttributeStorage {
 } // namespace impl
 } // namespace mlir
 
-DataLayoutEntryAttr DataLayoutEntryAttr::get(Identifier key, Attribute value) {
+DataLayoutEntryAttr DataLayoutEntryAttr::get(StringAttr key, Attribute value) {
   return Base::get(key.getContext(), key, value);
 }
 
@@ -89,7 +89,7 @@ DataLayoutEntryAttr DataLayoutEntryAttr::parse(AsmParser &parser) {
     return {};
 
   return type ? get(type, value)
-              : get(parser.getBuilder().getIdentifier(identifier), value);
+              : get(parser.getBuilder().getStringAttr(identifier), value);
 }
 
 void DataLayoutEntryAttr::print(AsmPrinter &os) const {
@@ -97,7 +97,7 @@ void DataLayoutEntryAttr::print(AsmPrinter &os) const {
   if (auto type = getKey().dyn_cast<Type>())
     os << type;
   else
-    os << "\"" << getKey().get<Identifier>().strref() << "\"";
+    os << "\"" << getKey().get<StringAttr>().strref() << "\"";
   os << ", " << getValue() << ">";
 }
 
@@ -146,13 +146,13 @@ LogicalResult
 DataLayoutSpecAttr::verify(function_ref<InFlightDiagnostic()> emitError,
                            ArrayRef<DataLayoutEntryInterface> entries) {
   DenseSet<Type> types;
-  DenseSet<Identifier> ids;
+  DenseSet<StringAttr> ids;
   for (DataLayoutEntryInterface entry : entries) {
     if (auto type = entry.getKey().dyn_cast<Type>()) {
       if (!types.insert(type).second)
         return emitError() << "repeated layout entry key: " << type;
     } else {
-      auto id = entry.getKey().get<Identifier>();
+      auto id = entry.getKey().get<StringAttr>();
       if (!ids.insert(id).second)
         return emitError() << "repeated layout entry key: " << id.getValue();
     }
@@ -191,13 +191,13 @@ overwriteDuplicateEntries(SmallVectorImpl<DataLayoutEntryInterface> &oldEntries,
 static LogicalResult
 combineOneSpec(DataLayoutSpecInterface spec,
                DenseMap<TypeID, DataLayoutEntryList> &entriesForType,
-               DenseMap<Identifier, DataLayoutEntryInterface> &entriesForID) {
+               DenseMap<StringAttr, DataLayoutEntryInterface> &entriesForID) {
   // A missing spec should be fine.
   if (!spec)
     return success();
 
   DenseMap<TypeID, DataLayoutEntryList> newEntriesForType;
-  DenseMap<Identifier, DataLayoutEntryInterface> newEntriesForID;
+  DenseMap<StringAttr, DataLayoutEntryInterface> newEntriesForID;
   spec.bucketEntriesByType(newEntriesForType, newEntriesForID);
 
   // Try overwriting the old entries with the new ones.
@@ -220,7 +220,7 @@ combineOneSpec(DataLayoutSpecInterface spec,
   }
 
   for (const auto &kvp : newEntriesForID) {
-    Identifier id = kvp.second.getKey().get<Identifier>();
+    StringAttr id = kvp.second.getKey().get<StringAttr>();
     Dialect *dialect = id.getReferencedDialect();
     if (!entriesForID.count(id)) {
       entriesForID[id] = kvp.second;
@@ -253,7 +253,7 @@ DataLayoutSpecAttr::combineWith(ArrayRef<DataLayoutSpecInterface> specs) const {
 
   // Combine all specs in order, with `this` being the last one.
   DenseMap<TypeID, DataLayoutEntryList> entriesForType;
-  DenseMap<Identifier, DataLayoutEntryInterface> entriesForID;
+  DenseMap<StringAttr, DataLayoutEntryInterface> entriesForID;
   for (DataLayoutSpecInterface spec : specs)
     if (failed(combineOneSpec(spec, entriesForType, entriesForID)))
       return nullptr;
@@ -320,7 +320,7 @@ class TargetDataLayoutInterface : public DataLayoutDialectInterface {
 
   LogicalResult verifyEntry(DataLayoutEntryInterface entry,
                             Location loc) const final {
-    StringRef entryName = entry.getKey().get<Identifier>().strref();
+    StringRef entryName = entry.getKey().get<StringAttr>().strref();
     if (entryName == DLTIDialect::kDataLayoutEndiannessKey) {
       auto value = entry.getValue().dyn_cast<StringAttr>();
       if (value &&

diff  --git a/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp b/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp
index d2d1752499adb..db5da26cc9a8c 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp
@@ -35,12 +35,12 @@ void mlir::linalg::CodegenStrategy::configurePassPipeline(
     const std::unique_ptr<Transformation> &t =
         transformationSequence[stepCount];
     std::string currentStr = std::to_string(stepCount);
-    auto currentState = Identifier::get(currentStr, context);
+    auto currentState = StringAttr::get(context, currentStr);
     std::string nextStr = std::to_string(stepCount + 1);
-    auto nextState = Identifier::get(nextStr, context);
+    auto nextState = StringAttr::get(context, nextStr);
     auto filter = (currentState.str() == std::to_string(0))
                       ? linalg::LinalgTransformationFilter(
-                            t->filter, ArrayRef<Identifier>{}, nextState)
+                            t->filter, ArrayRef<StringAttr>{}, nextState)
                       : linalg::LinalgTransformationFilter(
                             t->filter, currentState, nextState);
     t->addToPassPipeline(pm, filter);

diff  --git a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
index d7a26eebae0fa..8ccdb7f62246e 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
@@ -447,8 +447,8 @@ class RewritePatternList<OpTy, OpTypes...> {
     auto *ctx = patterns.getContext();
     patterns.add<LinalgTilingPattern<OpTy>>(
         ctx, options,
-        LinalgTransformationFilter(ArrayRef<Identifier>{},
-                                   Identifier::get("tiled", ctx)));
+        LinalgTransformationFilter(ArrayRef<StringAttr>{},
+                                   StringAttr::get(ctx, "tiled")));
     RewritePatternList<OpTypes...>::insert(patterns, options);
   }
 };

diff  --git a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
index a4b4d78e1073c..57cc48fd314c7 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
@@ -49,13 +49,13 @@ const StringLiteral mlir::linalg::LinalgTransforms::kLinalgTransformMarker =
     "__internal_linalg_transform__";
 
 mlir::linalg::LinalgTransformationFilter::LinalgTransformationFilter(
-    ArrayRef<Identifier> matchDisjunction, Optional<Identifier> replacement)
+    ArrayRef<StringAttr> matchDisjunction, Optional<StringAttr> replacement)
     : matchDisjunction(matchDisjunction.begin(), matchDisjunction.end()),
       replacement(replacement), matchByDefault(false) {}
 
 mlir::linalg::LinalgTransformationFilter::LinalgTransformationFilter(
-    FilterFunction f, ArrayRef<Identifier> matchDisjunction,
-    Optional<Identifier> replacement)
+    FilterFunction f, ArrayRef<StringAttr> matchDisjunction,
+    Optional<StringAttr> replacement)
     : filters(),
       matchDisjunction(matchDisjunction.begin(), matchDisjunction.end()),
       replacement(replacement), matchByDefault(false) {
@@ -101,10 +101,10 @@ void mlir::linalg::LinalgTransformationFilter::
                                       Operation *op) const {
   if (replacement.hasValue())
     op->setAttr(LinalgTransforms::kLinalgTransformMarker,
-                rewriter.getStringAttr(replacement.getValue().strref()));
+                replacement.getValue());
   else
-    op->removeAttr(Identifier::get(LinalgTransforms::kLinalgTransformMarker,
-                                   rewriter.getContext()));
+    op->removeAttr(
+        rewriter.getStringAttr(LinalgTransforms::kLinalgTransformMarker));
 }
 
 LinalgTilingOptions &

diff  --git a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
index 002f791a63d59..206daf9c81650 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
@@ -1171,13 +1171,13 @@ static void populateVectorizationPatterns(
   constexpr static StringRef kPromotedMarker = "PROMOTED";
   tilingPatterns.add<LinalgTilingPattern<ConvOp>>(
       context, LinalgTilingOptions().setTileSizes(tileSizes),
-      LinalgTransformationFilter(ArrayRef<Identifier>{},
-                                 Identifier::get(kTiledMarker, context)));
+      LinalgTransformationFilter(ArrayRef<StringAttr>{},
+                                 StringAttr::get(kTiledMarker, context)));
 
   promotionPatterns.add<LinalgPromotionPattern<ConvOp>>(
       context, LinalgPromotionOptions().setUseFullTileBuffersByDefault(true),
-      LinalgTransformationFilter(Identifier::get(kTiledMarker, context),
-                                 Identifier::get(kPromotedMarker, context)));
+      LinalgTransformationFilter(StringAttr::get(kTiledMarker, context),
+                                 StringAttr::get(kPromotedMarker, context)));
 
   SmallVector<bool, 4> mask(N);
   int offset = tileSizes.size() - N;

diff  --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
index 17ee2dfb0ec05..05b5dafb8a682 100644
--- a/mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
+++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
@@ -14,7 +14,6 @@
 #include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
 #include "mlir/IR/Attributes.h"
 #include "mlir/IR/BuiltinTypes.h"
-#include "mlir/IR/Identifier.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/TypeSwitch.h"
 

diff  --git a/mlir/lib/Dialect/Shape/IR/Shape.cpp b/mlir/lib/Dialect/Shape/IR/Shape.cpp
index 27d60b5f02f34..f6978935d73a0 100644
--- a/mlir/lib/Dialect/Shape/IR/Shape.cpp
+++ b/mlir/lib/Dialect/Shape/IR/Shape.cpp
@@ -207,7 +207,7 @@ LogicalResult ShapeDialect::verifyOperationAttribute(Operation *op,
     if (auto arr = attribute.second.dyn_cast<ArrayAttr>()) {
       // Verify all entries are function libraries and mappings in libraries
       // refer to unique ops.
-      DenseSet<Identifier> key;
+      DenseSet<StringAttr> key;
       for (auto it : arr) {
         if (!it.isa<SymbolRefAttr>())
           return op->emitError(

diff  --git a/mlir/lib/IR/AttributeDetail.h b/mlir/lib/IR/AttributeDetail.h
index 03373ae70abe4..630040229acb7 100644
--- a/mlir/lib/IR/AttributeDetail.h
+++ b/mlir/lib/IR/AttributeDetail.h
@@ -16,7 +16,6 @@
 #include "mlir/IR/AffineMap.h"
 #include "mlir/IR/BuiltinAttributes.h"
 #include "mlir/IR/BuiltinTypes.h"
-#include "mlir/IR/Identifier.h"
 #include "mlir/IR/IntegerSet.h"
 #include "mlir/IR/MLIRContext.h"
 #include "mlir/Support/StorageUniquer.h"

diff  --git a/mlir/lib/IR/Builders.cpp b/mlir/lib/IR/Builders.cpp
index 68471a5fbf7da..9b91054104dd4 100644
--- a/mlir/lib/IR/Builders.cpp
+++ b/mlir/lib/IR/Builders.cpp
@@ -19,8 +19,8 @@
 
 using namespace mlir;
 
-Identifier Builder::getIdentifier(const Twine &str) {
-  return Identifier::get(str, context);
+StringAttr Builder::getIdentifier(const Twine &str) {
+  return getStringAttr(str);
 }
 
 //===----------------------------------------------------------------------===//
@@ -83,7 +83,7 @@ NoneType Builder::getNoneType() { return NoneType::get(context); }
 //===----------------------------------------------------------------------===//
 
 NamedAttribute Builder::getNamedAttr(StringRef name, Attribute val) {
-  return NamedAttribute(getIdentifier(name), val);
+  return NamedAttribute(getStringAttr(name), val);
 }
 
 UnitAttr Builder::getUnitAttr() { return UnitAttr::get(context); }

diff  --git a/mlir/lib/IR/BuiltinAttributes.cpp b/mlir/lib/IR/BuiltinAttributes.cpp
index 6b48e31369040..d4477fe591350 100644
--- a/mlir/lib/IR/BuiltinAttributes.cpp
+++ b/mlir/lib/IR/BuiltinAttributes.cpp
@@ -188,7 +188,7 @@ Attribute DictionaryAttr::get(StringRef name) const {
   auto it = impl::findAttrSorted(begin(), end(), name);
   return it.second ? it.first->second : Attribute();
 }
-Attribute DictionaryAttr::get(Identifier name) const {
+Attribute DictionaryAttr::get(StringAttr name) const {
   auto it = impl::findAttrSorted(begin(), end(), name);
   return it.second ? it.first->second : Attribute();
 }
@@ -198,7 +198,7 @@ Optional<NamedAttribute> DictionaryAttr::getNamed(StringRef name) const {
   auto it = impl::findAttrSorted(begin(), end(), name);
   return it.second ? *it.first : Optional<NamedAttribute>();
 }
-Optional<NamedAttribute> DictionaryAttr::getNamed(Identifier name) const {
+Optional<NamedAttribute> DictionaryAttr::getNamed(StringAttr name) const {
   auto it = impl::findAttrSorted(begin(), end(), name);
   return it.second ? *it.first : Optional<NamedAttribute>();
 }
@@ -207,7 +207,7 @@ Optional<NamedAttribute> DictionaryAttr::getNamed(Identifier name) const {
 bool DictionaryAttr::contains(StringRef name) const {
   return impl::findAttrSorted(begin(), end(), name).second;
 }
-bool DictionaryAttr::contains(Identifier name) const {
+bool DictionaryAttr::contains(StringAttr name) const {
   return impl::findAttrSorted(begin(), end(), name).second;
 }
 
@@ -394,7 +394,7 @@ bool BoolAttr::classof(Attribute attr) {
 //===----------------------------------------------------------------------===//
 
 LogicalResult OpaqueAttr::verify(function_ref<InFlightDiagnostic()> emitError,
-                                 Identifier dialect, StringRef attrData,
+                                 StringAttr dialect, StringRef attrData,
                                  Type type) {
   if (!Dialect::isValidNamespace(dialect.strref()))
     return emitError() << "invalid dialect namespace '" << dialect << "'";
@@ -1247,7 +1247,7 @@ bool OpaqueElementsAttr::decode(ElementsAttr &result) {
 
 LogicalResult
 OpaqueElementsAttr::verify(function_ref<InFlightDiagnostic()> emitError,
-                           Identifier dialect, StringRef value,
+                           StringAttr dialect, StringRef value,
                            ShapedType type) {
   if (!Dialect::isValidNamespace(dialect.strref()))
     return emitError() << "invalid dialect namespace '" << dialect << "'";

diff  --git a/mlir/lib/IR/BuiltinDialect.cpp b/mlir/lib/IR/BuiltinDialect.cpp
index a007a487d8afc..3dd653ddf3dcd 100644
--- a/mlir/lib/IR/BuiltinDialect.cpp
+++ b/mlir/lib/IR/BuiltinDialect.cpp
@@ -153,7 +153,7 @@ static LogicalResult verify(FuncOp op) {
 /// from this function to dest.
 void FuncOp::cloneInto(FuncOp dest, BlockAndValueMapping &mapper) {
   // Add the attributes of this function to dest.
-  llvm::MapVector<Identifier, Attribute> newAttrs;
+  llvm::MapVector<StringAttr, Attribute> newAttrs;
   for (const auto &attr : dest->getAttrs())
     newAttrs.insert(attr);
   for (const auto &attr : (*this)->getAttrs())

diff  --git a/mlir/lib/IR/BuiltinTypes.cpp b/mlir/lib/IR/BuiltinTypes.cpp
index 2ca794eddf2b0..e71f335d882cb 100644
--- a/mlir/lib/IR/BuiltinTypes.cpp
+++ b/mlir/lib/IR/BuiltinTypes.cpp
@@ -251,7 +251,7 @@ void FunctionType::walkImmediateSubElements(
 
 /// Verify the construction of an opaque type.
 LogicalResult OpaqueType::verify(function_ref<InFlightDiagnostic()> emitError,
-                                 Identifier dialect, StringRef typeData) {
+                                 StringAttr dialect, StringRef typeData) {
   if (!Dialect::isValidNamespace(dialect.strref()))
     return emitError() << "invalid dialect namespace '" << dialect << "'";
 

diff  --git a/mlir/lib/IR/Dialect.cpp b/mlir/lib/IR/Dialect.cpp
index 0170b99c0d1a6..56bd66967f145 100644
--- a/mlir/lib/IR/Dialect.cpp
+++ b/mlir/lib/IR/Dialect.cpp
@@ -156,7 +156,7 @@ Attribute Dialect::parseAttribute(DialectAsmParser &parser, Type type) const {
 Type Dialect::parseType(DialectAsmParser &parser) const {
   // If this dialect allows unknown types, then represent this with OpaqueType.
   if (allowsUnknownTypes()) {
-    Identifier ns = Identifier::get(getNamespace(), getContext());
+    StringAttr ns = StringAttr::get(getContext(), getNamespace());
     return OpaqueType::get(ns, parser.getFullSymbolSpec());
   }
 

diff  --git a/mlir/lib/IR/Location.cpp b/mlir/lib/IR/Location.cpp
index 6a39efa0cc39f..1de4d73bbe4fa 100644
--- a/mlir/lib/IR/Location.cpp
+++ b/mlir/lib/IR/Location.cpp
@@ -8,7 +8,6 @@
 
 #include "mlir/IR/Location.h"
 #include "mlir/IR/BuiltinDialect.h"
-#include "mlir/IR/Identifier.h"
 #include "mlir/IR/Visitors.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/TypeSwitch.h"

diff  --git a/mlir/lib/IR/MLIRContext.cpp b/mlir/lib/IR/MLIRContext.cpp
index aa907ea75fc3d..91f51d9f0497f 100644
--- a/mlir/lib/IR/MLIRContext.cpp
+++ b/mlir/lib/IR/MLIRContext.cpp
@@ -772,14 +772,14 @@ void AbstractOperation::insert(
          "context");
 
   // Register the attribute names of this operation.
-  MutableArrayRef<Identifier> cachedAttrNames;
+  MutableArrayRef<StringAttr> cachedAttrNames;
   if (!attrNames.empty()) {
-    cachedAttrNames = MutableArrayRef<Identifier>(
-        impl.abstractDialectSymbolAllocator.Allocate<Identifier>(
+    cachedAttrNames = MutableArrayRef<StringAttr>(
+        impl.abstractDialectSymbolAllocator.Allocate<StringAttr>(
             attrNames.size()),
         attrNames.size());
     for (unsigned i : llvm::seq<unsigned>(0, attrNames.size()))
-      new (&cachedAttrNames[i]) Identifier(Identifier::get(attrNames[i], ctx));
+      new (&cachedAttrNames[i]) StringAttr(StringAttr::get(ctx, attrNames[i]));
   }
 
   // Register the information for this operation.
@@ -801,8 +801,8 @@ AbstractOperation::AbstractOperation(
     VerifyInvariantsFn &&verifyInvariants, FoldHookFn &&foldHook,
     GetCanonicalizationPatternsFn &&getCanonicalizationPatterns,
     detail::InterfaceMap &&interfaceMap, HasTraitFn &&hasTrait,
-    ArrayRef<Identifier> attrNames)
-    : name(Identifier::get(name, dialect.getContext())), dialect(dialect),
+    ArrayRef<StringAttr> attrNames)
+    : name(StringAttr::get(dialect.getContext(), name)), dialect(dialect),
       typeID(typeID), interfaceMap(std::move(interfaceMap)),
       foldHookFn(std::move(foldHook)),
       getCanonicalizationPatternsFn(std::move(getCanonicalizationPatterns)),

diff  --git a/mlir/lib/IR/Operation.cpp b/mlir/lib/IR/Operation.cpp
index d232b1d253ac3..cfbb9a97e632e 100644
--- a/mlir/lib/IR/Operation.cpp
+++ b/mlir/lib/IR/Operation.cpp
@@ -30,7 +30,7 @@ OperationName::OperationName(StringRef name, MLIRContext *context) {
   if (auto *op = AbstractOperation::lookup(name, context))
     representation = op;
   else
-    representation = Identifier::get(name, context);
+    representation = StringAttr::get(name, context);
 }
 
 /// Return the name of the dialect this operation is registered to.
@@ -51,10 +51,10 @@ StringRef OperationName::getStringRef() const {
 }
 
 /// Return the name of this operation as an identifier. This always succeeds.
-Identifier OperationName::getIdentifier() const {
+StringAttr OperationName::getIdentifier() const {
   if (auto *op = representation.dyn_cast<const AbstractOperation *>())
     return op->name;
-  return representation.get<Identifier>();
+  return representation.get<StringAttr>();
 }
 
 OperationName OperationName::getFromOpaquePointer(const void *pointer) {

diff  --git a/mlir/lib/IR/OperationSupport.cpp b/mlir/lib/IR/OperationSupport.cpp
index c78fc52c9d240..a0303bd3f0e5d 100644
--- a/mlir/lib/IR/OperationSupport.cpp
+++ b/mlir/lib/IR/OperationSupport.cpp
@@ -62,7 +62,7 @@ DictionaryAttr NamedAttrList::getDictionary(MLIRContext *context) const {
 
 /// Add an attribute with the specified name.
 void NamedAttrList::append(StringRef name, Attribute attr) {
-  append(Identifier::get(name, attr.getContext()), attr);
+  append(StringAttr::get(attr.getContext(), name), attr);
 }
 
 /// Replaces the attributes with new list of attributes.
@@ -86,7 +86,7 @@ Attribute NamedAttrList::get(StringRef name) const {
   auto it = findAttr(*this, name);
   return it.second ? it.first->second : Attribute();
 }
-Attribute NamedAttrList::get(Identifier name) const {
+Attribute NamedAttrList::get(StringAttr name) const {
   auto it = findAttr(*this, name);
   return it.second ? it.first->second : Attribute();
 }
@@ -96,14 +96,14 @@ Optional<NamedAttribute> NamedAttrList::getNamed(StringRef name) const {
   auto it = findAttr(*this, name);
   return it.second ? *it.first : Optional<NamedAttribute>();
 }
-Optional<NamedAttribute> NamedAttrList::getNamed(Identifier name) const {
+Optional<NamedAttribute> NamedAttrList::getNamed(StringAttr name) const {
   auto it = findAttr(*this, name);
   return it.second ? *it.first : Optional<NamedAttribute>();
 }
 
 /// If the an attribute exists with the specified name, change it to the new
 /// value.  Otherwise, add a new attribute with the specified name/value.
-Attribute NamedAttrList::set(Identifier name, Attribute value) {
+Attribute NamedAttrList::set(StringAttr name, Attribute value) {
   assert(value && "attributes may never be null");
 
   // Look for an existing attribute with the given name, and set its value
@@ -131,7 +131,7 @@ Attribute NamedAttrList::set(Identifier name, Attribute value) {
 
 Attribute NamedAttrList::set(StringRef name, Attribute value) {
   assert(value && "attributes may never be null");
-  return set(mlir::Identifier::get(name, value.getContext()), value);
+  return set(mlir::StringAttr::get(value.getContext(), name), value);
 }
 
 Attribute
@@ -143,7 +143,7 @@ NamedAttrList::eraseImpl(SmallVectorImpl<NamedAttribute>::iterator it) {
   return attr;
 }
 
-Attribute NamedAttrList::erase(Identifier name) {
+Attribute NamedAttrList::erase(StringAttr name) {
   auto it = findAttr(*this, name);
   return it.second ? eraseImpl(it.first) : Attribute();
 }

diff  --git a/mlir/lib/IR/SymbolTable.cpp b/mlir/lib/IR/SymbolTable.cpp
index 93d605ff1e845..1dbb1168e1f55 100644
--- a/mlir/lib/IR/SymbolTable.cpp
+++ b/mlir/lib/IR/SymbolTable.cpp
@@ -27,7 +27,7 @@ static bool isPotentiallyUnknownSymbolTable(Operation *op) {
 static StringAttr getNameIfSymbol(Operation *op) {
   return op->getAttrOfType<StringAttr>(SymbolTable::getSymbolAttrName());
 }
-static StringAttr getNameIfSymbol(Operation *op, Identifier symbolAttrNameId) {
+static StringAttr getNameIfSymbol(Operation *op, StringAttr symbolAttrNameId) {
   return op->getAttrOfType<StringAttr>(symbolAttrNameId);
 }
 
@@ -52,8 +52,8 @@ collectValidReferencesFor(Operation *symbol, StringAttr symbolName,
 
   // Collect references until 'symbolTableOp' reaches 'within'.
   SmallVector<FlatSymbolRefAttr, 1> nestedRefs(1, leafRef);
-  Identifier symbolNameId =
-      Identifier::get(SymbolTable::getSymbolAttrName(), ctx);
+  StringAttr symbolNameId =
+      StringAttr::get(ctx, SymbolTable::getSymbolAttrName());
   do {
     // Each parent of 'symbol' should define a symbol table.
     if (!symbolTableOp->hasTrait<OpTrait::SymbolTable>())
@@ -111,8 +111,8 @@ SymbolTable::SymbolTable(Operation *symbolTableOp)
   assert(llvm::hasSingleElement(symbolTableOp->getRegion(0)) &&
          "expected operation to have a single block");
 
-  Identifier symbolNameId = Identifier::get(SymbolTable::getSymbolAttrName(),
-                                            symbolTableOp->getContext());
+  StringAttr symbolNameId = StringAttr::get(symbolTableOp->getContext(),
+                                            SymbolTable::getSymbolAttrName());
   for (auto &op : symbolTableOp->getRegion(0).front()) {
     StringAttr name = getNameIfSymbol(&op, symbolNameId);
     if (!name)
@@ -235,7 +235,7 @@ void SymbolTable::setSymbolVisibility(Operation *symbol, Visibility vis) {
   // If the visibility is public, just drop the attribute as this is the
   // default.
   if (vis == Visibility::Public) {
-    symbol->removeAttr(Identifier::get(getVisibilityAttrName(), ctx));
+    symbol->removeAttr(StringAttr::get(ctx, getVisibilityAttrName()));
     return;
   }
 
@@ -305,8 +305,8 @@ Operation *SymbolTable::lookupSymbolIn(Operation *symbolTableOp,
     return nullptr;
 
   // Look for a symbol with the given name.
-  Identifier symbolNameId = Identifier::get(SymbolTable::getSymbolAttrName(),
-                                            symbolTableOp->getContext());
+  StringAttr symbolNameId = StringAttr::get(symbolTableOp->getContext(),
+                                            SymbolTable::getSymbolAttrName());
   for (auto &op : region.front())
     if (getNameIfSymbol(&op, symbolNameId) == symbol)
       return &op;

diff  --git a/mlir/lib/IR/TypeDetail.h b/mlir/lib/IR/TypeDetail.h
index 09bfbf0fcf37c..c1079a468c4af 100644
--- a/mlir/lib/IR/TypeDetail.h
+++ b/mlir/lib/IR/TypeDetail.h
@@ -14,7 +14,6 @@
 
 #include "mlir/IR/AffineMap.h"
 #include "mlir/IR/BuiltinTypes.h"
-#include "mlir/IR/Identifier.h"
 #include "mlir/IR/MLIRContext.h"
 #include "mlir/IR/OperationSupport.h"
 #include "mlir/IR/TypeRange.h"

diff  --git a/mlir/lib/Interfaces/DataLayoutInterfaces.cpp b/mlir/lib/Interfaces/DataLayoutInterfaces.cpp
index 5223c31cd75c0..2b7ff5ef60583 100644
--- a/mlir/lib/Interfaces/DataLayoutInterfaces.cpp
+++ b/mlir/lib/Interfaces/DataLayoutInterfaces.cpp
@@ -147,11 +147,11 @@ mlir::detail::filterEntriesForType(DataLayoutEntryListRef entries,
 
 DataLayoutEntryInterface
 mlir::detail::filterEntryForIdentifier(DataLayoutEntryListRef entries,
-                                       Identifier id) {
+                                       StringAttr id) {
   const auto *it = llvm::find_if(entries, [id](DataLayoutEntryInterface entry) {
-    if (!entry.getKey().is<Identifier>())
+    if (!entry.getKey().is<StringAttr>())
       return false;
-    return entry.getKey().get<Identifier>() == id;
+    return entry.getKey().get<StringAttr>() == id;
   });
   return it == entries.end() ? DataLayoutEntryInterface() : *it;
 }
@@ -384,12 +384,12 @@ unsigned mlir::DataLayout::getTypePreferredAlignment(Type t) const {
 
 void DataLayoutSpecInterface::bucketEntriesByType(
     DenseMap<TypeID, DataLayoutEntryList> &types,
-    DenseMap<Identifier, DataLayoutEntryInterface> &ids) {
+    DenseMap<StringAttr, DataLayoutEntryInterface> &ids) {
   for (DataLayoutEntryInterface entry : getEntries()) {
     if (auto type = entry.getKey().dyn_cast<Type>())
       types[type.getTypeID()].push_back(entry);
     else
-      ids[entry.getKey().get<Identifier>()] = entry;
+      ids[entry.getKey().get<StringAttr>()] = entry;
   }
 }
 
@@ -403,7 +403,7 @@ LogicalResult mlir::detail::verifyDataLayoutSpec(DataLayoutSpecInterface spec,
   // Second, dispatch verifications of entry groups to types or dialects they
   // are are associated with.
   DenseMap<TypeID, DataLayoutEntryList> types;
-  DenseMap<Identifier, DataLayoutEntryInterface> ids;
+  DenseMap<StringAttr, DataLayoutEntryInterface> ids;
   spec.bucketEntriesByType(types, ids);
 
   for (const auto &kvp : types) {
@@ -430,7 +430,7 @@ LogicalResult mlir::detail::verifyDataLayoutSpec(DataLayoutSpecInterface spec,
   }
 
   for (const auto &kvp : ids) {
-    Identifier identifier = kvp.second.getKey().get<Identifier>();
+    StringAttr identifier = kvp.second.getKey().get<StringAttr>();
     Dialect *dialect = identifier.getReferencedDialect();
 
     // Ignore attributes that belong to an unknown dialect, the dialect may

diff  --git a/mlir/lib/Parser/AttributeParser.cpp b/mlir/lib/Parser/AttributeParser.cpp
index 11b9f03b10d3e..63b85427e2539 100644
--- a/mlir/lib/Parser/AttributeParser.cpp
+++ b/mlir/lib/Parser/AttributeParser.cpp
@@ -260,15 +260,15 @@ OptionalParseResult Parser::parseOptionalAttribute(StringAttr &attribute,
 ///   attribute-entry ::= (bare-id | string-literal) `=` attribute-value
 ///
 ParseResult Parser::parseAttributeDict(NamedAttrList &attributes) {
-  llvm::SmallDenseSet<Identifier> seenKeys;
+  llvm::SmallDenseSet<StringAttr> seenKeys;
   auto parseElt = [&]() -> ParseResult {
     // The name of an attribute can either be a bare identifier, or a string.
-    Optional<Identifier> nameId;
+    Optional<StringAttr> nameId;
     if (getToken().is(Token::string))
-      nameId = builder.getIdentifier(getToken().getStringValue());
+      nameId = builder.getStringAttr(getToken().getStringValue());
     else if (getToken().isAny(Token::bare_identifier, Token::inttype) ||
              getToken().isKeyword())
-      nameId = builder.getIdentifier(getTokenSpelling());
+      nameId = builder.getStringAttr(getTokenSpelling());
     else
       return emitError("expected attribute name");
     if (!seenKeys.insert(*nameId).second)
@@ -856,7 +856,7 @@ Attribute Parser::parseOpaqueElementsAttr(Type attrType) {
   std::string data;
   if (parseElementAttrHexValues(*this, hexTok, data))
     return nullptr;
-  return OpaqueElementsAttr::get(builder.getIdentifier(name), type, data);
+  return OpaqueElementsAttr::get(builder.getStringAttr(name), type, data);
 }
 
 /// Shaped type for elements attribute.

diff  --git a/mlir/lib/Parser/DialectSymbolParser.cpp b/mlir/lib/Parser/DialectSymbolParser.cpp
index b6b32072eb2e1..36f583c602117 100644
--- a/mlir/lib/Parser/DialectSymbolParser.cpp
+++ b/mlir/lib/Parser/DialectSymbolParser.cpp
@@ -258,7 +258,7 @@ Attribute Parser::parseExtendedAttr(Type type) {
         // Otherwise, form a new opaque attribute.
         return OpaqueAttr::getChecked(
             [&] { return emitError(loc); },
-            Identifier::get(dialectName, state.context), symbolData,
+            StringAttr::get(state.context, dialectName), symbolData,
             attrType ? attrType : NoneType::get(state.context));
       });
 
@@ -297,7 +297,7 @@ Type Parser::parseExtendedType() {
         // Otherwise, form a new opaque type.
         return OpaqueType::getChecked(
             [&] { return emitError(loc); },
-            Identifier::get(dialectName, state.context), symbolData);
+            StringAttr::get(state.context, dialectName), symbolData);
       });
 }
 

diff  --git a/mlir/lib/Parser/Lexer.cpp b/mlir/lib/Parser/Lexer.cpp
index 129fb3e500c6f..56ffc90cf6e8c 100644
--- a/mlir/lib/Parser/Lexer.cpp
+++ b/mlir/lib/Parser/Lexer.cpp
@@ -12,7 +12,6 @@
 
 #include "Lexer.h"
 #include "mlir/IR/Diagnostics.h"
-#include "mlir/IR/Identifier.h"
 #include "mlir/IR/Location.h"
 #include "mlir/IR/MLIRContext.h"
 #include "llvm/ADT/StringExtras.h"

diff  --git a/mlir/lib/Parser/LocationParser.cpp b/mlir/lib/Parser/LocationParser.cpp
index d010260e84836..469fa9f6a9bf1 100644
--- a/mlir/lib/Parser/LocationParser.cpp
+++ b/mlir/lib/Parser/LocationParser.cpp
@@ -137,14 +137,14 @@ ParseResult Parser::parseNameOrFileLineColLocation(LocationAttr &loc) {
     if (childLoc.isa<NameLoc>())
       return emitError(childSourceLoc,
                        "child of NameLoc cannot be another NameLoc");
-    loc = NameLoc::get(Identifier::get(str, ctx), childLoc);
+    loc = NameLoc::get(StringAttr::get(ctx, str), childLoc);
 
     // Parse the closing ')'.
     if (parseToken(Token::r_paren,
                    "expected ')' after child location of NameLoc"))
       return failure();
   } else {
-    loc = NameLoc::get(Identifier::get(str, ctx));
+    loc = NameLoc::get(StringAttr::get(ctx, str));
   }
 
   return success();

diff  --git a/mlir/lib/Pass/Pass.cpp b/mlir/lib/Pass/Pass.cpp
index f8551fcb44fa8..57ede84c5a439 100644
--- a/mlir/lib/Pass/Pass.cpp
+++ b/mlir/lib/Pass/Pass.cpp
@@ -80,7 +80,7 @@ void Pass::printAsTextualPipeline(raw_ostream &os) {
 namespace mlir {
 namespace detail {
 struct OpPassManagerImpl {
-  OpPassManagerImpl(Identifier identifier, OpPassManager::Nesting nesting)
+  OpPassManagerImpl(StringAttr identifier, OpPassManager::Nesting nesting)
       : name(identifier.str()), identifier(identifier),
         initializationGeneration(0), nesting(nesting) {}
   OpPassManagerImpl(StringRef name, OpPassManager::Nesting nesting)
@@ -91,7 +91,7 @@ struct OpPassManagerImpl {
 
   /// Nest a new operation pass manager for the given operation kind under this
   /// pass manager.
-  OpPassManager &nest(Identifier nestedName);
+  OpPassManager &nest(StringAttr nestedName);
   OpPassManager &nest(StringRef nestedName);
 
   /// Add the given pass to this pass manager. If this pass has a concrete
@@ -107,9 +107,9 @@ struct OpPassManagerImpl {
   void coalesceAdjacentAdaptorPasses();
 
   /// Return the operation name of this pass manager as an identifier.
-  Identifier getOpName(MLIRContext &context) {
+  StringAttr getOpName(MLIRContext &context) {
     if (!identifier)
-      identifier = Identifier::get(name, &context);
+      identifier = StringAttr::get(name, &context);
     return *identifier;
   }
 
@@ -118,7 +118,7 @@ struct OpPassManagerImpl {
 
   /// The cached identifier (internalized in the context) for the name of the
   /// operation that passes of this pass manager operate on.
-  Optional<Identifier> identifier;
+  Optional<StringAttr> identifier;
 
   /// The set of passes to run as part of this pass manager.
   std::vector<std::unique_ptr<Pass>> passes;
@@ -141,7 +141,7 @@ void OpPassManagerImpl::mergeInto(OpPassManagerImpl &rhs) {
   passes.clear();
 }
 
-OpPassManager &OpPassManagerImpl::nest(Identifier nestedName) {
+OpPassManager &OpPassManagerImpl::nest(StringAttr nestedName) {
   OpPassManager nested(nestedName, nesting);
   auto *adaptor = new OpToOpPassAdaptor(std::move(nested));
   addPass(std::unique_ptr<Pass>(adaptor));
@@ -219,7 +219,7 @@ void OpPassManagerImpl::coalesceAdjacentAdaptorPasses() {
 // OpPassManager
 //===----------------------------------------------------------------------===//
 
-OpPassManager::OpPassManager(Identifier name, Nesting nesting)
+OpPassManager::OpPassManager(StringAttr name, Nesting nesting)
     : impl(new OpPassManagerImpl(name, nesting)) {}
 OpPassManager::OpPassManager(StringRef name, Nesting nesting)
     : impl(new OpPassManagerImpl(name, nesting)) {}
@@ -254,7 +254,7 @@ OpPassManager::const_pass_iterator OpPassManager::end() const {
 
 /// Nest a new operation pass manager for the given operation kind under this
 /// pass manager.
-OpPassManager &OpPassManager::nest(Identifier nestedName) {
+OpPassManager &OpPassManager::nest(StringAttr nestedName) {
   return impl->nest(nestedName);
 }
 OpPassManager &OpPassManager::nest(StringRef nestedName) {
@@ -279,7 +279,7 @@ OpPassManagerImpl &OpPassManager::getImpl() { return *impl; }
 StringRef OpPassManager::getOpName() const { return impl->name; }
 
 /// Return the operation name that this pass manager operates on.
-Identifier OpPassManager::getOpName(MLIRContext &context) const {
+StringAttr OpPassManager::getOpName(MLIRContext &context) const {
   return impl->getOpName(context);
 }
 
@@ -468,7 +468,7 @@ static OpPassManager *findPassManagerFor(MutableArrayRef<OpPassManager> mgrs,
 /// Find an operation pass manager that can operate on an operation of the given
 /// type, or nullptr if one does not exist.
 static OpPassManager *findPassManagerFor(MutableArrayRef<OpPassManager> mgrs,
-                                         Identifier name,
+                                         StringAttr name,
                                          MLIRContext &context) {
   auto it = llvm::find_if(
       mgrs, [&](OpPassManager &mgr) { return mgr.getOpName(context) == name; });
@@ -630,7 +630,7 @@ void OpToOpPassAdaptor::runOnOperationAsyncImpl(bool verifyPasses) {
 
 PassManager::PassManager(MLIRContext *ctx, Nesting nesting,
                          StringRef operationName)
-    : OpPassManager(Identifier::get(operationName, ctx), nesting), context(ctx),
+    : OpPassManager(StringAttr::get(ctx, operationName), nesting), context(ctx),
       initializationKey(DenseMapInfo<llvm::hash_code>::getTombstoneKey()),
       passTiming(false), verifyPasses(true) {}
 
@@ -794,7 +794,7 @@ PassInstrumentor::~PassInstrumentor() {}
 
 /// See PassInstrumentation::runBeforePipeline for details.
 void PassInstrumentor::runBeforePipeline(
-    Identifier name,
+    StringAttr name,
     const PassInstrumentation::PipelineParentInfo &parentInfo) {
   llvm::sys::SmartScopedLock<true> instrumentationLock(impl->mutex);
   for (auto &instr : impl->instrumentations)
@@ -803,7 +803,7 @@ void PassInstrumentor::runBeforePipeline(
 
 /// See PassInstrumentation::runAfterPipeline for details.
 void PassInstrumentor::runAfterPipeline(
-    Identifier name,
+    StringAttr name,
     const PassInstrumentation::PipelineParentInfo &parentInfo) {
   llvm::sys::SmartScopedLock<true> instrumentationLock(impl->mutex);
   for (auto &instr : llvm::reverse(impl->instrumentations))

diff  --git a/mlir/lib/Pass/PassTiming.cpp b/mlir/lib/Pass/PassTiming.cpp
index ef22443edfb09..f063d95248dd0 100644
--- a/mlir/lib/Pass/PassTiming.cpp
+++ b/mlir/lib/Pass/PassTiming.cpp
@@ -52,7 +52,7 @@ struct PassTiming : public PassInstrumentation {
   // Pipeline
   //===--------------------------------------------------------------------===//
 
-  void runBeforePipeline(Identifier name,
+  void runBeforePipeline(StringAttr name,
                          const PipelineParentInfo &parentInfo) override {
     auto tid = llvm::get_threadid();
     auto &activeTimers = activeThreadTimers[tid];
@@ -73,7 +73,7 @@ struct PassTiming : public PassInstrumentation {
     }));
   }
 
-  void runAfterPipeline(Identifier, const PipelineParentInfo &) override {
+  void runAfterPipeline(StringAttr, const PipelineParentInfo &) override {
     auto &activeTimers = activeThreadTimers[llvm::get_threadid()];
     assert(!activeTimers.empty() && "expected active timer");
     activeTimers.pop_back();

diff  --git a/mlir/lib/Rewrite/ByteCode.cpp b/mlir/lib/Rewrite/ByteCode.cpp
index 4370b23bb7b2b..98854564da735 100644
--- a/mlir/lib/Rewrite/ByteCode.cpp
+++ b/mlir/lib/Rewrite/ByteCode.cpp
@@ -721,11 +721,8 @@ void Generator::generate(pdl_interp::CreateOperationOp op,
   // Add the attributes.
   OperandRange attributes = op.attributes();
   writer.append(static_cast<ByteCodeField>(attributes.size()));
-  for (auto it : llvm::zip(op.attributeNames(), op.attributes())) {
-    writer.append(
-        Identifier::get(std::get<0>(it).cast<StringAttr>().getValue(), ctx),
-        std::get<1>(it));
-  }
+  for (auto it : llvm::zip(op.attributeNames(), op.attributes()))
+    writer.append(std::get<0>(it), std::get<1>(it));
   writer.appendPDLValueList(op.types());
 }
 void Generator::generate(pdl_interp::CreateTypeOp op, ByteCodeWriter &writer) {
@@ -745,7 +742,7 @@ void Generator::generate(pdl_interp::FinalizeOp op, ByteCodeWriter &writer) {
 void Generator::generate(pdl_interp::GetAttributeOp op,
                          ByteCodeWriter &writer) {
   writer.append(OpCode::GetAttribute, op.attribute(), op.operation(),
-                Identifier::get(op.name(), ctx));
+                op.nameAttr());
 }
 void Generator::generate(pdl_interp::GetAttributeTypeOp op,
                          ByteCodeWriter &writer) {
@@ -1307,7 +1304,7 @@ void ByteCodeExecutor::executeCreateOperation(PatternRewriter &rewriter,
   OperationState state(mainRewriteLoc, read<OperationName>());
   readValueList(state.operands);
   for (unsigned i = 0, e = read(); i != e; ++i) {
-    Identifier name = read<Identifier>();
+    StringAttr name = read<StringAttr>();
     if (Attribute attr = read<Attribute>())
       state.addAttribute(name, attr);
   }
@@ -1364,7 +1361,7 @@ void ByteCodeExecutor::executeGetAttribute() {
   LLVM_DEBUG(llvm::dbgs() << "Executing GetAttribute:\n");
   unsigned memIndex = read();
   Operation *op = read<Operation *>();
-  Identifier attrName = read<Identifier>();
+  StringAttr attrName = read<StringAttr>();
   Attribute attr = op->getAttr(attrName);
 
   LLVM_DEBUG(llvm::dbgs() << "  * Operation: " << *op << "\n"

diff  --git a/mlir/lib/Rewrite/ByteCode.h b/mlir/lib/Rewrite/ByteCode.h
index c6f41be768dea..941b782dcd4e7 100644
--- a/mlir/lib/Rewrite/ByteCode.h
+++ b/mlir/lib/Rewrite/ByteCode.h
@@ -168,7 +168,7 @@ class PDLByteCode {
   /// A vector containing pointers to uniqued data. The storage is intentionally
   /// opaque such that we can store a wide range of data types. The types of
   /// data stored here include:
-  ///  * Attribute, Identifier, OperationName, Type
+  ///  * Attribute, OperationName, Type
   std::vector<const void *> uniquedData;
 
   /// A vector containing the generated bytecode for the matcher.

diff  --git a/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp b/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
index 077c7c3de682b..e8adf0d013496 100644
--- a/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
+++ b/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
@@ -803,7 +803,7 @@ LogicalResult Importer::processFunction(llvm::Function *f) {
                            convertLinkageFromLLVM(f->getLinkage()));
 
   if (FlatSymbolRefAttr personality = getPersonalityAsAttr(f))
-    fop->setAttr(b.getIdentifier("personality"), personality);
+    fop->setAttr(b.getStringAttr("personality"), personality);
   else if (f->hasPersonalityFn())
     emitWarning(UnknownLoc::get(context),
                 "could not deduce personality, skipping it");

diff  --git a/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp b/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
index b74b4873442bd..e60d1a9f6789a 100644
--- a/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
+++ b/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
@@ -227,7 +227,7 @@ LogicalResult spirv::Deserializer::processDecoration(ArrayRef<uint32_t> words) {
     return emitError(unknownLoc, "invalid Decoration code : ") << words[1];
   }
   auto attrName = llvm::convertToSnakeFromCamelCase(decorationName);
-  auto symbol = opBuilder.getIdentifier(attrName);
+  auto symbol = opBuilder.getStringAttr(attrName);
   switch (static_cast<spirv::Decoration>(words[1])) {
   case spirv::Decoration::DescriptorSet:
   case spirv::Decoration::Binding:
@@ -1964,7 +1964,7 @@ Location spirv::Deserializer::createFileLineColLoc(OpBuilder opBuilder) {
   auto fileName = debugInfoMap.lookup(debugLine->fileID).str();
   if (fileName.empty())
     fileName = "<unknown>";
-  return FileLineColLoc::get(opBuilder.getIdentifier(fileName), debugLine->line,
+  return FileLineColLoc::get(opBuilder.getStringAttr(fileName), debugLine->line,
                              debugLine->col);
 }
 

diff  --git a/mlir/lib/Transforms/LocationSnapshot.cpp b/mlir/lib/Transforms/LocationSnapshot.cpp
index a7e08723bcec9..4e77b1d08328c 100644
--- a/mlir/lib/Transforms/LocationSnapshot.cpp
+++ b/mlir/lib/Transforms/LocationSnapshot.cpp
@@ -30,12 +30,12 @@ static void generateLocationsFromIR(raw_ostream &os, StringRef fileName,
   op->print(os, state, flags);
 
   Builder builder(op->getContext());
-  Optional<Identifier> tagIdentifier;
+  Optional<StringAttr> tagIdentifier;
   if (!tag.empty())
-    tagIdentifier = builder.getIdentifier(tag);
+    tagIdentifier = builder.getStringAttr(tag);
 
   // Walk and generate new locations for each of the operations.
-  Identifier file = builder.getIdentifier(fileName);
+  StringAttr file = builder.getStringAttr(fileName);
   op->walk([&](Operation *opIt) {
     // Check to see if this operation has a mapped location. Some operations may
     // be elided from the printed form, e.g. the body terminators of some region

diff  --git a/mlir/test/lib/Dialect/Linalg/TestLinalgDistribution.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgDistribution.cpp
index 5e7c5d5a5b79e..54c5bd1976a1f 100644
--- a/mlir/test/lib/Dialect/Linalg/TestLinalgDistribution.cpp
+++ b/mlir/test/lib/Dialect/Linalg/TestLinalgDistribution.cpp
@@ -58,8 +58,8 @@ void TestLinalgDistribution::runOnFunction() {
   populateLinalgDistributeTiledLoopPattern(
       distributeTiledLoopsPatterns, getDistributionOptions(),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>{},
-          {Identifier::get("distributed", funcOp.getContext())})
+          ArrayRef<StringAttr>{},
+          {StringAttr::get("distributed", funcOp.getContext())})
           .addFilter([](Operation *op) {
             return success(!op->getParentOfType<linalg::TiledLoopOp>());
           }));

diff  --git a/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp
index 7d87e9ae6d7c2..39f8cca3c1125 100644
--- a/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp
+++ b/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp
@@ -31,81 +31,81 @@ static void fillFusionPatterns(MLIRContext *context,
       LinalgTilingOptions().setTileSizes({32, 64, 16}).setLoopType(LoopType),
       LinalgFusionOptions().setIndicesToFuse({2}),
       LinalgTransformationFilter(
-          Identifier::get("basic_fusion", context),
-          Identifier::get("after_basic_fusion", context)),
+          StringAttr::get(context, "basic_fusion"),
+          StringAttr::get(context, "after_basic_fusion")),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>(),
-          Identifier::get("after_basic_fusion_producer", context)),
+          ArrayRef<StringAttr>(),
+          StringAttr::get(context, "after_basic_fusion_producer")),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>(),
-          Identifier::get("after_basic_fusion_original", context)));
+          ArrayRef<StringAttr>(),
+          StringAttr::get(context, "after_basic_fusion_original")));
 
   patterns.add<LinalgTileAndFusePattern<MatmulOp>>(
       context, dependenceGraph,
       LinalgTilingOptions().setTileSizes({32, 64, 16}).setLoopType(LoopType),
       LinalgFusionOptions().setIndicesToFuse({0}),
-      LinalgTransformationFilter(Identifier::get("lhs_fusion", context),
-                                 Identifier::get("after_lhs_fusion", context)),
+      LinalgTransformationFilter(StringAttr::get(context, "lhs_fusion"),
+                                 StringAttr::get(context, "after_lhs_fusion")),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>(),
-          Identifier::get("after_lhs_fusion_producer", context)),
+          ArrayRef<StringAttr>(),
+          StringAttr::get(context, "after_lhs_fusion_producer")),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>(),
-          Identifier::get("after_lhs_fusion_original", context)));
+          ArrayRef<StringAttr>(),
+          StringAttr::get(context, "after_lhs_fusion_original")));
 
   patterns.add<LinalgTileAndFusePattern<MatmulOp>>(
       context, dependenceGraph,
       LinalgTilingOptions().setTileSizes({32, 64, 16}).setLoopType(LoopType),
       LinalgFusionOptions().setIndicesToFuse({2}),
-      LinalgTransformationFilter(Identifier::get("out_fusion", context),
-                                 Identifier::get("after_out_fusion", context)),
+      LinalgTransformationFilter(StringAttr::get(context, "out_fusion"),
+                                 StringAttr::get(context, "after_out_fusion")),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>(),
-          Identifier::get("after_out_fusion_producer", context)),
+          ArrayRef<StringAttr>(),
+          StringAttr::get(context, "after_out_fusion_producer")),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>(),
-          Identifier::get("after_out_fusion_original", context)));
+          ArrayRef<StringAttr>(),
+          StringAttr::get(context, "after_out_fusion_original")));
 
   patterns.add<LinalgTileAndFusePattern<MatmulOp>>(
       context, dependenceGraph,
       LinalgTilingOptions().setTileSizes({32, 64, 16}).setLoopType(LoopType),
       LinalgFusionOptions().setIndicesToFuse({1}),
-      LinalgTransformationFilter(Identifier::get("rhs_fusion", context),
-                                 Identifier::get("after_rhs_fusion", context)),
+      LinalgTransformationFilter(StringAttr::get(context, "rhs_fusion"),
+                                 StringAttr::get(context, "after_rhs_fusion")),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>(),
-          Identifier::get("after_rhs_fusion_producer", context)),
+          ArrayRef<StringAttr>(),
+          StringAttr::get(context, "after_rhs_fusion_producer")),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>(),
-          Identifier::get("after_rhs_fusion_original", context)));
+          ArrayRef<StringAttr>(),
+          StringAttr::get(context, "after_rhs_fusion_original")));
 
   patterns.add<LinalgTileAndFusePattern<MatmulOp>>(
       context, dependenceGraph,
       LinalgTilingOptions().setTileSizes({32, 64, 16}).setLoopType(LoopType),
       LinalgFusionOptions().setIndicesToFuse({0, 2}),
       LinalgTransformationFilter(
-          Identifier::get("two_operand_fusion", context),
-          Identifier::get("after_two_operand_fusion", context)),
+          StringAttr::get(context, "two_operand_fusion"),
+          StringAttr::get(context, "after_two_operand_fusion")),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>(),
-          Identifier::get("after_two_operand_fusion_producer", context)),
+          ArrayRef<StringAttr>(),
+          StringAttr::get(context, "after_two_operand_fusion_producer")),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>(),
-          Identifier::get("after_two_operand_fusion_original", context)));
+          ArrayRef<StringAttr>(),
+          StringAttr::get(context, "after_two_operand_fusion_original")));
 
   patterns.add<LinalgTileAndFusePattern<GenericOp>>(
       context, dependenceGraph,
       LinalgTilingOptions().setTileSizes({32, 64}).setLoopType(LoopType),
       LinalgFusionOptions().setIndicesToFuse({0, 1}),
       LinalgTransformationFilter(
-          Identifier::get("transpose_fusion", context),
-          Identifier::get("after_transpose_fusion", context)),
+          StringAttr::get(context, "transpose_fusion"),
+          StringAttr::get(context, "after_transpose_fusion")),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>(),
-          Identifier::get("after_transpose_fusion_producer", context)),
+          ArrayRef<StringAttr>(),
+          StringAttr::get(context, "after_transpose_fusion_producer")),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>(),
-          Identifier::get("after_transpose_fusion_original", context)));
+          ArrayRef<StringAttr>(),
+          StringAttr::get(context, "after_transpose_fusion_original")));
 }
 
 namespace {

diff  --git a/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp
index 8f0b43afafcb1..c9ae47d6d975e 100644
--- a/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp
+++ b/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp
@@ -145,35 +145,35 @@ static void applyPatterns(FuncOp funcOp) {
   //===--------------------------------------------------------------------===//
   patterns.add<LinalgTilingPattern<MatmulOp>>(
       ctx, LinalgTilingOptions().setTileSizes({2000, 3000, 4000}),
-      LinalgTransformationFilter(Identifier::get("MEM", ctx),
-                                 Identifier::get("L3", ctx)));
+      LinalgTransformationFilter(StringAttr::get(ctx, "MEM"),
+                                 StringAttr::get(ctx, "L3")));
   patterns.add<LinalgTilingPattern<MatmulOp>>(
       ctx, LinalgTilingOptions().setTileSizes({200, 300, 400}),
-      LinalgTransformationFilter(Identifier::get("L3", ctx),
-                                 Identifier::get("L2", ctx)));
+      LinalgTransformationFilter(StringAttr::get(ctx, "L3"),
+                                 StringAttr::get(ctx, "L2")));
   patterns.add<LinalgTilingPattern<MatmulOp>>(
       ctx, LinalgTilingOptions().setTileSizes({20, 30, 40}),
-      LinalgTransformationFilter(Identifier::get("L2", ctx),
-                                 Identifier::get("L1", ctx)));
+      LinalgTransformationFilter(StringAttr::get(ctx, "L2"),
+                                 StringAttr::get(ctx, "L1")));
   patterns.add<LinalgTilingPattern<MatmulOp>>(
       ctx, LinalgTilingOptions().setTileSizes({2, 3, 4}),
-      LinalgTransformationFilter(Identifier::get("L1", ctx),
-                                 Identifier::get("REG", ctx)));
+      LinalgTransformationFilter(StringAttr::get(ctx, "L1"),
+                                 StringAttr::get(ctx, "REG")));
 
   patterns.add<LinalgTilingPattern<MatvecOp>>(
       ctx,
       LinalgTilingOptions().setTileSizes({5, 6}).setLoopType(
           LinalgTilingLoopType::ParallelLoops),
-      LinalgTransformationFilter(ArrayRef<Identifier>{},
-                                 Identifier::get("L1", ctx)));
+      LinalgTransformationFilter(ArrayRef<StringAttr>{},
+                                 StringAttr::get(ctx, "L1")));
 
   patterns.add<LinalgTilingPattern<DotOp>>(
       ctx, LinalgTilingOptions().setTileSizes(8000),
       LinalgTransformationFilter(
-          ArrayRef<Identifier>{Identifier::get("MEM", ctx),
-                               Identifier::get("L3", ctx),
-                               Identifier::get("L2", ctx)},
-          Identifier::get("REG", ctx)));
+          ArrayRef<StringAttr>{StringAttr::get(ctx, "MEM"),
+                               StringAttr::get(ctx, "L3"),
+                               StringAttr::get(ctx, "L2")},
+          StringAttr::get(ctx, "REG")));
 
   //===--------------------------------------------------------------------===//
   // Linalg tiling and permutation patterns.
@@ -183,24 +183,24 @@ static void applyPatterns(FuncOp funcOp) {
       LinalgTilingOptions()
           .setTileSizes({2000, 3000, 4000})
           .setInterchange({1, 2, 0}),
-      LinalgTransformationFilter(Identifier::get("__with_perm__", ctx),
-                                 Identifier::get("L2__with_perm__", ctx)));
+      LinalgTransformationFilter(StringAttr::get(ctx, "__with_perm__"),
+                                 StringAttr::get(ctx, "L2__with_perm__")));
   patterns.add<LinalgTilingPattern<MatmulOp>>(
       ctx,
       LinalgTilingOptions()
           .setTileSizes({200, 300, 400})
           .setInterchange({1, 0, 2}),
-      LinalgTransformationFilter(Identifier::get("L2__with_perm__", ctx),
-                                 Identifier::get("L1__with_perm__", ctx)));
+      LinalgTransformationFilter(StringAttr::get(ctx, "L2__with_perm__"),
+                                 StringAttr::get(ctx, "L1__with_perm__")));
   patterns.add<LinalgTilingPattern<MatmulOp>>(
       ctx, LinalgTilingOptions().setTileSizes({20, 30, 40}),
-      LinalgTransformationFilter(Identifier::get("L1__with_perm__", ctx),
-                                 Identifier::get("REG__with_perm__", ctx)));
+      LinalgTransformationFilter(StringAttr::get(ctx, "L1__with_perm__"),
+                                 StringAttr::get(ctx, "REG__with_perm__")));
 
   patterns.add<LinalgTilingPattern<MatvecOp>>(
       ctx, LinalgTilingOptions().setTileSizes({5, 6}).setInterchange({1, 0}),
-      LinalgTransformationFilter(Identifier::get("__with_perm__", ctx),
-                                 Identifier::get("L1__with_perm__", ctx)));
+      LinalgTransformationFilter(StringAttr::get(ctx, "__with_perm__"),
+                                 StringAttr::get(ctx, "L1__with_perm__")));
 
   patterns.add<LinalgTilingPattern<MatmulOp>>(
       ctx,
@@ -209,8 +209,8 @@ static void applyPatterns(FuncOp funcOp) {
           .setInterchange({1, 2, 0})
           .setLoopType(LinalgTilingLoopType::ParallelLoops),
       LinalgTransformationFilter(
-          Identifier::get("par__with_perm__", ctx),
-          Identifier::get("after_par__with_perm__", ctx)));
+          StringAttr::get(ctx, "par__with_perm__"),
+          StringAttr::get(ctx, "after_par__with_perm__")));
 
   //===--------------------------------------------------------------------===//
   // Linalg to loops patterns.
@@ -218,7 +218,7 @@ static void applyPatterns(FuncOp funcOp) {
   patterns.add<LinalgLoweringPattern<DotOp>>(
       ctx,
       /*loweringType=*/LinalgLoweringType::Loops,
-      LinalgTransformationFilter(Identifier::get("REG", ctx)));
+      LinalgTransformationFilter(StringAttr::get(ctx, "REG")));
 
   //===--------------------------------------------------------------------===//
   // Linalg distribution patterns.
@@ -229,7 +229,7 @@ static void applyPatterns(FuncOp funcOp) {
   // Linalg to vector contraction patterns.
   //===--------------------------------------------------------------------===//
   patterns.add<LinalgVectorizationPattern>(
-      ctx, LinalgTransformationFilter(Identifier::get("VECTORIZE", ctx))
+      ctx, LinalgTransformationFilter(StringAttr::get(ctx, "VECTORIZE"))
                .addOpFilter<MatmulOp, FillOp, CopyOp, GenericOp>());
 
   //===--------------------------------------------------------------------===//
@@ -238,24 +238,24 @@ static void applyPatterns(FuncOp funcOp) {
   patterns.add<GenericOpInterchangePattern>(
       ctx,
       /*interchangeVector=*/ArrayRef<unsigned>{1, 2, 0},
-      LinalgTransformationFilter(ArrayRef<Identifier>{},
-                                 Identifier::get("PERMUTED", ctx)));
+      LinalgTransformationFilter(ArrayRef<StringAttr>{},
+                                 StringAttr::get(ctx, "PERMUTED")));
 
   //===--------------------------------------------------------------------===//
   // Linalg subview operands promotion.
   //===--------------------------------------------------------------------===//
   patterns.add<LinalgPromotionPattern<MatmulOp>>(
       ctx, LinalgPromotionOptions().setUseFullTileBuffersByDefault(true),
-      LinalgTransformationFilter(Identifier::get("_promote_views_", ctx),
-                                 Identifier::get("_views_promoted_", ctx)));
+      LinalgTransformationFilter(StringAttr::get(ctx, "_promote_views_"),
+                                 StringAttr::get(ctx, "_views_promoted_")));
   patterns.add<LinalgPromotionPattern<MatmulOp>>(
       ctx,
       LinalgPromotionOptions()
           .setOperandsToPromote({0})
           .setUseFullTileBuffersByDefault(true),
       LinalgTransformationFilter(
-          Identifier::get("_promote_first_view_", ctx),
-          Identifier::get("_first_view_promoted_", ctx)));
+          StringAttr::get(ctx, "_promote_first_view_"),
+          StringAttr::get(ctx, "_first_view_promoted_")));
   patterns.add<LinalgPromotionPattern<FillOp>>(
       ctx,
       LinalgPromotionOptions()
@@ -263,8 +263,8 @@ static void applyPatterns(FuncOp funcOp) {
           .setUseFullTileBuffers({false, true})
           .setAlignment(32),
       LinalgTransformationFilter(
-          Identifier::get("_promote_views_aligned_", ctx),
-          Identifier::get("_views_aligned_promoted_", ctx)));
+          StringAttr::get(ctx, "_promote_views_aligned_"),
+          StringAttr::get(ctx, "_views_aligned_promoted_")));
 
   (void)applyPatternsAndFoldGreedily(funcOp, std::move(patterns));
 
@@ -284,20 +284,20 @@ static void fillL1TilingAndMatmulToVectorPatterns(
                LinalgTilingOptions()
                    .setTileSizes({8, 12, 16})
                    .setInterchange({1, 0, 2}),
-               LinalgTransformationFilter(Identifier::get(startMarker, ctx),
-                                          Identifier::get("L1", ctx))));
+               LinalgTransformationFilter(StringAttr::get(ctx, startMarker),
+                                          StringAttr::get(ctx, "L1"))));
 
   patternsVector.emplace_back(
       ctx,
       std::make_unique<LinalgPromotionPattern<MatmulOp>>(
           ctx, LinalgPromotionOptions().setUseFullTileBuffersByDefault(true),
-          LinalgTransformationFilter(Identifier::get("L1", ctx),
-                                     Identifier::get("VEC", ctx))));
+          LinalgTransformationFilter(StringAttr::get(ctx, "L1"),
+                                     StringAttr::get(ctx, "VEC"))));
 
   patternsVector.emplace_back(
       ctx, std::make_unique<LinalgVectorizationPattern>(
                MatmulOp::getOperationName(), ctx, LinalgVectorizationOptions(),
-               LinalgTransformationFilter(Identifier::get("VEC", ctx))));
+               LinalgTransformationFilter(StringAttr::get(ctx, "VEC"))));
   patternsVector.back().add<LinalgVectorizationPattern>(
       ctx, LinalgTransformationFilter().addFilter(
                [](Operation *op) { return success(isa<FillOp, CopyOp>(op)); }));
@@ -346,8 +346,8 @@ static void fillPromotionCallBackPatterns(MLIRContext *ctx,
                                           RewritePatternSet &patterns) {
   patterns.add<LinalgTilingPattern<MatmulOp>>(
       ctx, LinalgTilingOptions().setTileSizes({16, 16, 16}),
-      LinalgTransformationFilter(Identifier::get("START", ctx),
-                                 Identifier::get("PROMOTE", ctx)));
+      LinalgTransformationFilter(StringAttr::get(ctx, "START"),
+                                 StringAttr::get(ctx, "PROMOTE")));
   patterns.add<LinalgPromotionPattern<MatmulOp>>(
       ctx,
       LinalgPromotionOptions()
@@ -361,7 +361,7 @@ static void fillPromotionCallBackPatterns(MLIRContext *ctx,
               [](OpBuilder &b, Value src, Value dst) -> LogicalResult {
                 return copyCallBackFn(b, src, dst, true);
               }),
-      LinalgTransformationFilter(Identifier::get("PROMOTE", ctx)));
+      LinalgTransformationFilter(StringAttr::get(ctx, "PROMOTE")));
 }
 
 template <typename IdOp, typename NProcsOp>
@@ -394,8 +394,8 @@ static void fillTileAndDistributePatterns(MLIRContext *context,
             .setLoopType(LinalgTilingLoopType::ParallelLoops)
             .setDistributionOptions(cyclicNprocsEqNiters),
         LinalgTransformationFilter(
-            Identifier::get("distribute1", context),
-            Identifier::get("after_distribute1", context)));
+            StringAttr::get(context, "distribute1"),
+            StringAttr::get(context, "after_distribute1")));
   }
 
   {
@@ -411,8 +411,8 @@ static void fillTileAndDistributePatterns(MLIRContext *context,
             .setLoopType(LinalgTilingLoopType::ParallelLoops)
             .setDistributionOptions(cyclicNprocsGeNiters),
         LinalgTransformationFilter(
-            Identifier::get("distribute2", context),
-            Identifier::get("after_distribute2", context)));
+            StringAttr::get(context, "distribute2"),
+            StringAttr::get(context, "after_distribute2")));
   }
 
   {
@@ -428,8 +428,8 @@ static void fillTileAndDistributePatterns(MLIRContext *context,
             .setLoopType(LinalgTilingLoopType::ParallelLoops)
             .setDistributionOptions(cyclicNprocsDefault),
         LinalgTransformationFilter(
-            Identifier::get("distribute3", context),
-            Identifier::get("after_distribute3", context)));
+            StringAttr::get(context, "distribute3"),
+            StringAttr::get(context, "after_distribute3")));
   }
 
   {
@@ -445,8 +445,8 @@ static void fillTileAndDistributePatterns(MLIRContext *context,
             .setLoopType(LinalgTilingLoopType::ParallelLoops)
             .setDistributionOptions(cyclicNprocsMixed1),
         LinalgTransformationFilter(
-            Identifier::get("distribute4", context),
-            Identifier::get("after_distribute4", context)));
+            StringAttr::get(context, "distribute4"),
+            StringAttr::get(context, "after_distribute4")));
   }
 
   {
@@ -462,8 +462,8 @@ static void fillTileAndDistributePatterns(MLIRContext *context,
             .setLoopType(LinalgTilingLoopType::ParallelLoops)
             .setDistributionOptions(cyclicNprocsMixed2),
         LinalgTransformationFilter(
-            Identifier::get("distribute5", context),
-            Identifier::get("after_distribute5", context)));
+            StringAttr::get(context, "distribute5"),
+            StringAttr::get(context, "after_distribute5")));
   }
 
   {
@@ -480,8 +480,8 @@ static void fillTileAndDistributePatterns(MLIRContext *context,
             .setLoopType(LinalgTilingLoopType::ParallelLoops)
             .setDistributionOptions(cyclicNprocsMixed3),
         LinalgTransformationFilter(
-            Identifier::get("distribute6", context),
-            Identifier::get("after_distribute6", context)));
+            StringAttr::get(context, "distribute6"),
+            StringAttr::get(context, "after_distribute6")));
   }
 
   {
@@ -495,10 +495,10 @@ static void fillTileAndDistributePatterns(MLIRContext *context,
         LinalgTilingOptions()
             .setTileSizes({8, 8, 4})
             .setLoopType(LinalgTilingLoopType::Loops)
-          .setDistributionOptions(cyclicNprocsEqNiters),
+            .setDistributionOptions(cyclicNprocsEqNiters),
         LinalgTransformationFilter(
-            Identifier::get("tensors_distribute1", context),
-            Identifier::get("tensors_after_distribute1", context)));
+            StringAttr::get(context, "tensors_distribute1"),
+            StringAttr::get(context, "tensors_after_distribute1")));
   }
 }
 
@@ -517,8 +517,8 @@ applyMatmulToVectorPatterns(FuncOp funcOp,
                  LinalgTilingOptions()
                      .setTileSizes({768, 264, 768})
                      .setInterchange({1, 2, 0}),
-                 LinalgTransformationFilter(Identifier::get("START", ctx),
-                                            Identifier::get("L2", ctx))));
+                 LinalgTransformationFilter(StringAttr::get(ctx, "START"),
+                                            StringAttr::get(ctx, "L2"))));
     fillL1TilingAndMatmulToVectorPatterns(funcOp, "L2", stage1Patterns);
   }
   {
@@ -598,7 +598,7 @@ static void applyTilePattern(FuncOp funcOp, std::string loopType,
   tilingPattern.add<linalg::LinalgTilingPattern<linalg::MatmulOp>,
                     linalg::LinalgTilingPattern<linalg::GenericOp>>(
       context, linalgTilingOptions,
-      linalg::LinalgTransformationFilter(Identifier::get("tile", context)));
+      linalg::LinalgTransformationFilter(StringAttr::get(context, "tile")));
   (void)applyPatternsAndFoldGreedily(funcOp, std::move(tilingPattern));
 }
 

diff  --git a/mlir/test/lib/Dialect/Shape/TestShapeFunctions.cpp b/mlir/test/lib/Dialect/Shape/TestShapeFunctions.cpp
index b1479456f23ff..03ab46af0a7f1 100644
--- a/mlir/test/lib/Dialect/Shape/TestShapeFunctions.cpp
+++ b/mlir/test/lib/Dialect/Shape/TestShapeFunctions.cpp
@@ -31,7 +31,7 @@ void ReportShapeFnPass::runOnOperation() {
   auto module = getOperation();
 
   // Report the shape function available to refine the op.
-  auto shapeFnId = Identifier::get("shape.function", &getContext());
+  auto shapeFnId = StringAttr::get(&getContext(), "shape.function");
   auto remarkShapeFn = [&](shape::FunctionLibraryOp shapeFnLib, Operation *op) {
     if (op->hasTrait<OpTrait::IsTerminator>())
       return true;

diff  --git a/mlir/test/lib/Dialect/Test/TestDialect.cpp b/mlir/test/lib/Dialect/Test/TestDialect.cpp
index 6ee1e79e8f4b2..e52bdfb5a5f98 100644
--- a/mlir/test/lib/Dialect/Test/TestDialect.cpp
+++ b/mlir/test/lib/Dialect/Test/TestDialect.cpp
@@ -963,7 +963,7 @@ static ParseResult parseStringAttrPrettyNameOp(OpAsmParser &parser,
   }
 
   auto namesAttr = parser.getBuilder().getStrArrayAttr(names);
-  result.attributes.push_back({Identifier::get("names", context), namesAttr});
+  result.attributes.push_back({StringAttr::get(context, "names"), namesAttr});
   return success();
 }
 

diff  --git a/mlir/test/mlir-tblgen/op-attribute.td b/mlir/test/mlir-tblgen/op-attribute.td
index ee3f7ba0f1295..823c55fc8cd17 100644
--- a/mlir/test/mlir-tblgen/op-attribute.td
+++ b/mlir/test/mlir-tblgen/op-attribute.td
@@ -43,19 +43,19 @@ def AOp : NS_Op<"a_op", []> {
 // DECL-SAME:     {::llvm::StringRef("aAttr"), ::llvm::StringRef("bAttr"), ::llvm::StringRef("cAttr")};
 // DECL-NEXT:   return ::llvm::makeArrayRef(attrNames);
 
-// DECL:      ::mlir::Identifier aAttrAttrName()
+// DECL:      ::mlir::StringAttr aAttrAttrName()
 // DECL-NEXT:      return getAttributeNameForIndex(0);
-// DECL:      ::mlir::Identifier aAttrAttrName(::mlir::OperationName name)
+// DECL:      ::mlir::StringAttr aAttrAttrName(::mlir::OperationName name)
 // DECL-NEXT:      return getAttributeNameForIndex(name, 0);
 
-// DECL:      ::mlir::Identifier bAttrAttrName()
+// DECL:      ::mlir::StringAttr bAttrAttrName()
 // DECL-NEXT:      return getAttributeNameForIndex(1);
-// DECL:      ::mlir::Identifier bAttrAttrName(::mlir::OperationName name)
+// DECL:      ::mlir::StringAttr bAttrAttrName(::mlir::OperationName name)
 // DECL-NEXT:      return getAttributeNameForIndex(name, 1);
 
-// DECL:      ::mlir::Identifier cAttrAttrName()
+// DECL:      ::mlir::StringAttr cAttrAttrName()
 // DECL-NEXT:      return getAttributeNameForIndex(2);
-// DECL:      ::mlir::Identifier cAttrAttrName(::mlir::OperationName name)
+// DECL:      ::mlir::StringAttr cAttrAttrName(::mlir::OperationName name)
 // DECL-NEXT:      return getAttributeNameForIndex(name, 2);
 
 // DEF-LABEL: AOp definitions
@@ -157,19 +157,19 @@ def AgetOp : Op<Test2_Dialect, "a_get_op", []> {
 // DECL-SAME:     {::llvm::StringRef("aAttr"), ::llvm::StringRef("bAttr"), ::llvm::StringRef("cAttr")};
 // DECL-NEXT:   return ::llvm::makeArrayRef(attrNames);
 
-// DECL:      ::mlir::Identifier getAAttrAttrName()
+// DECL:      ::mlir::StringAttr getAAttrAttrName()
 // DECL-NEXT:      return getAttributeNameForIndex(0);
-// DECL:      ::mlir::Identifier getAAttrAttrName(::mlir::OperationName name)
+// DECL:      ::mlir::StringAttr getAAttrAttrName(::mlir::OperationName name)
 // DECL-NEXT:      return getAttributeNameForIndex(name, 0);
 
-// DECL:      ::mlir::Identifier getBAttrAttrName()
+// DECL:      ::mlir::StringAttr getBAttrAttrName()
 // DECL-NEXT:      return getAttributeNameForIndex(1);
-// DECL:      ::mlir::Identifier getBAttrAttrName(::mlir::OperationName name)
+// DECL:      ::mlir::StringAttr getBAttrAttrName(::mlir::OperationName name)
 // DECL-NEXT:      return getAttributeNameForIndex(name, 1);
 
-// DECL:      ::mlir::Identifier getCAttrAttrName()
+// DECL:      ::mlir::StringAttr getCAttrAttrName()
 // DECL-NEXT:      return getAttributeNameForIndex(2);
-// DECL:      ::mlir::Identifier getCAttrAttrName(::mlir::OperationName name)
+// DECL:      ::mlir::StringAttr getCAttrAttrName(::mlir::OperationName name)
 // DECL-NEXT:      return getAttributeNameForIndex(name, 2);
 
 // DEF-LABEL: AgetOp definitions

diff  --git a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
index 507713e256782..63ce33a3ed5bd 100644
--- a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
+++ b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
@@ -1092,7 +1092,7 @@ int main(int argc, char **argv) {
     }
 
     genContext.setLoc(NameLoc::get(
-        Identifier::get(opConfig.metadata->cppClassName, &mlirContext)));
+        StringAttr::get(&mlirContext, opConfig.metadata->cppClassName)));
     if (failed(generateOp(opConfig, genContext))) {
       return 1;
     }

diff  --git a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
index 5e1cb842f1bc0..b93a9e1c47546 100644
--- a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
@@ -655,7 +655,7 @@ void OpEmitter::genAttrNameGetters() {
   // Emit the getAttributeNameForIndex methods.
   {
     auto *method = opClass.addInlineMethod<Method::MP_Private>(
-        "::mlir::Identifier", "getAttributeNameForIndex",
+        "::mlir::StringAttr", "getAttributeNameForIndex",
         MethodParameter("unsigned", "index"));
     ERROR_IF_PRUNED(method, "getAttributeNameForIndex", op);
     method->body()
@@ -663,7 +663,7 @@ void OpEmitter::genAttrNameGetters() {
   }
   {
     auto *method = opClass.addStaticInlineMethod<Method::MP_Private>(
-        "::mlir::Identifier", "getAttributeNameForIndex",
+        "::mlir::StringAttr", "getAttributeNameForIndex",
         MethodParameter("::mlir::OperationName", "name"),
         MethodParameter("unsigned", "index"));
     ERROR_IF_PRUNED(method, "getAttributeNameForIndex", op);
@@ -683,7 +683,7 @@ void OpEmitter::genAttrNameGetters() {
       // Generate the non-static variant.
       {
         auto *method =
-            opClass.addInlineMethod("::mlir::Identifier", methodName);
+            opClass.addInlineMethod("::mlir::StringAttr", methodName);
         ERROR_IF_PRUNED(method, methodName, op);
         method->body()
             << llvm::formatv(attrNameMethodBody, attrIt.second).str();
@@ -692,7 +692,7 @@ void OpEmitter::genAttrNameGetters() {
       // Generate the static variant.
       {
         auto *method = opClass.addStaticInlineMethod(
-            "::mlir::Identifier", methodName,
+            "::mlir::StringAttr", methodName,
             MethodParameter("::mlir::OperationName", "name"));
         ERROR_IF_PRUNED(method, methodName, op);
         method->body() << llvm::formatv(attrNameMethodBody,

diff  --git a/mlir/tools/mlir-tblgen/RewriterGen.cpp b/mlir/tools/mlir-tblgen/RewriterGen.cpp
index bc74503f709e9..b217298690c8d 100644
--- a/mlir/tools/mlir-tblgen/RewriterGen.cpp
+++ b/mlir/tools/mlir-tblgen/RewriterGen.cpp
@@ -1145,7 +1145,7 @@ std::string PatternEmitter::handleLocationDirective(DagNode tree) {
   if (tree.getNumArgs() == 1) {
     DagLeaf leaf = tree.getArgAsLeaf(0);
     if (leaf.isStringAttr())
-      return formatv("::mlir::NameLoc::get(rewriter.getIdentifier(\"{0}\"))",
+      return formatv("::mlir::NameLoc::get(rewriter.getStringAttr(\"{0}\"))",
                      leaf.getStringAttr())
           .str();
     return lookUpArgLoc(0);
@@ -1607,7 +1607,7 @@ void PatternEmitter::createAggregateLocalVarsForOpArgs(
 
   const char *addAttrCmd =
       "if (auto tmpAttr = {1}) {\n"
-      "  tblgen_attrs.emplace_back(rewriter.getIdentifier(\"{0}\"), "
+      "  tblgen_attrs.emplace_back(rewriter.getStringAttr(\"{0}\"), "
       "tmpAttr);\n}\n";
   for (int argIndex = 0, e = resultOp.getNumArgs(); argIndex < e; ++argIndex) {
     if (resultOp.getArg(argIndex).is<NamedAttribute *>()) {

diff  --git a/mlir/tools/mlir-tblgen/StructsGen.cpp b/mlir/tools/mlir-tblgen/StructsGen.cpp
index 52f5223870179..e33b74b93e1fa 100644
--- a/mlir/tools/mlir-tblgen/StructsGen.cpp
+++ b/mlir/tools/mlir-tblgen/StructsGen.cpp
@@ -131,13 +131,13 @@ static void emitFactoryDef(llvm::StringRef structName,
 
   const char *getFieldInfo = R"(
   assert({0});
-  auto {0}_id = ::mlir::Identifier::get("{0}", context);
+  auto {0}_id = ::mlir::StringAttr::get(context, "{0}");
   fields.emplace_back({0}_id, {0});
 )";
 
   const char *getFieldInfoOptional = R"(
   if ({0}) {
-    auto {0}_id = ::mlir::Identifier::get("{0}", context);
+    auto {0}_id = ::mlir::StringAttr::get(context, "{0}");
     fields.emplace_back({0}_id, {0});
   }
 )";

diff  --git a/mlir/unittests/IR/AttributeTest.cpp b/mlir/unittests/IR/AttributeTest.cpp
index 19b57fa754df1..f76ab456391af 100644
--- a/mlir/unittests/IR/AttributeTest.cpp
+++ b/mlir/unittests/IR/AttributeTest.cpp
@@ -8,7 +8,6 @@
 
 #include "mlir/IR/BuiltinAttributes.h"
 #include "mlir/IR/BuiltinTypes.h"
-#include "mlir/IR/Identifier.h"
 #include "gtest/gtest.h"
 
 using namespace mlir;
@@ -152,7 +151,7 @@ TEST(DenseSplatTest, StringSplat) {
   MLIRContext context;
   context.allowUnregisteredDialects();
   Type stringType =
-      OpaqueType::get(Identifier::get("test", &context), "string");
+      OpaqueType::get(StringAttr::get(&context, "test"), "string");
   StringRef value = "test-string";
   testSplat(stringType, value);
 }
@@ -161,7 +160,7 @@ TEST(DenseSplatTest, StringAttrSplat) {
   MLIRContext context;
   context.allowUnregisteredDialects();
   Type stringType =
-      OpaqueType::get(Identifier::get("test", &context), "string");
+      OpaqueType::get(StringAttr::get(&context, "test"), "string");
   Attribute stringAttr = StringAttr::get("test-string", stringType);
   testSplat(stringType, stringAttr);
 }
@@ -211,7 +210,7 @@ TEST(SparseElementsAttrTest, GetZero) {
 
   IntegerType intTy = IntegerType::get(&context, 32);
   FloatType floatTy = FloatType::getF32(&context);
-  Type stringTy = OpaqueType::get(Identifier::get("test", &context), "string");
+  Type stringTy = OpaqueType::get(StringAttr::get(&context, "test"), "string");
 
   ShapedType tensorI32 = RankedTensorType::get({2, 2}, intTy);
   ShapedType tensorF32 = RankedTensorType::get({2, 2}, floatTy);

diff  --git a/mlir/unittests/IR/OperationSupportTest.cpp b/mlir/unittests/IR/OperationSupportTest.cpp
index 8c46d961f0cca..b0b48b099f2bc 100644
--- a/mlir/unittests/IR/OperationSupportTest.cpp
+++ b/mlir/unittests/IR/OperationSupportTest.cpp
@@ -237,10 +237,10 @@ TEST(NamedAttrListTest, TestAppendAssign) {
 
   {
     auto it = attrs.begin();
-    EXPECT_EQ(it->first, b.getIdentifier("foo"));
+    EXPECT_EQ(it->first, b.getStringAttr("foo"));
     EXPECT_EQ(it->second, b.getStringAttr("bar"));
     ++it;
-    EXPECT_EQ(it->first, b.getIdentifier("baz"));
+    EXPECT_EQ(it->first, b.getStringAttr("baz"));
     EXPECT_EQ(it->second, b.getStringAttr("boo"));
   }
 
@@ -261,10 +261,10 @@ TEST(NamedAttrListTest, TestAppendAssign) {
 
   {
     auto it = attrs.begin();
-    EXPECT_EQ(it->first, b.getIdentifier("foo"));
+    EXPECT_EQ(it->first, b.getStringAttr("foo"));
     EXPECT_EQ(it->second, b.getStringAttr("f"));
     ++it;
-    EXPECT_EQ(it->first, b.getIdentifier("zoo"));
+    EXPECT_EQ(it->first, b.getStringAttr("zoo"));
     EXPECT_EQ(it->second, b.getStringAttr("z"));
   }
 

diff  --git a/mlir/unittests/TableGen/OpBuildGen.cpp b/mlir/unittests/TableGen/OpBuildGen.cpp
index 672e44130dc61..5228390f677a3 100644
--- a/mlir/unittests/TableGen/OpBuildGen.cpp
+++ b/mlir/unittests/TableGen/OpBuildGen.cpp
@@ -15,7 +15,6 @@
 #include "mlir/IR/Builders.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/Dialect.h"
-#include "mlir/IR/Identifier.h"
 #include "gmock/gmock.h"
 #include <vector>
 

diff  --git a/mlir/unittests/TableGen/StructsGenTest.cpp b/mlir/unittests/TableGen/StructsGenTest.cpp
index 4fcdf1d673195..e1ebf1d668bbc 100644
--- a/mlir/unittests/TableGen/StructsGenTest.cpp
+++ b/mlir/unittests/TableGen/StructsGenTest.cpp
@@ -9,7 +9,6 @@
 #include "mlir/IR/Attributes.h"
 #include "mlir/IR/Builders.h"
 #include "mlir/IR/BuiltinTypes.h"
-#include "mlir/IR/Identifier.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringSwitch.h"
@@ -62,7 +61,7 @@ TEST(StructsGenTest, ClassofExtraFalse) {
                                                        expectedValues.end());
 
   // Add an extra NamedAttribute.
-  auto wrongId = mlir::Identifier::get("wrong", &context);
+  auto wrongId = mlir::StringAttr::get(&context, "wrong");
   auto wrongAttr = mlir::NamedAttribute(wrongId, expectedValues[0].second);
   newValues.push_back(wrongAttr);
 
@@ -83,8 +82,8 @@ TEST(StructsGenTest, ClassofBadNameFalse) {
   llvm::SmallVector<mlir::NamedAttribute, 4> newValues(
       expectedValues.begin() + 1, expectedValues.end());
 
-  // Add a copy of the first attribute with the wrong Identifier.
-  auto wrongId = mlir::Identifier::get("wrong", &context);
+  // Add a copy of the first attribute with the wrong name.
+  auto wrongId = mlir::StringAttr::get(&context, "wrong");
   auto wrongAttr = mlir::NamedAttribute(wrongId, expectedValues[0].second);
   newValues.push_back(wrongAttr);
 
@@ -109,7 +108,7 @@ TEST(StructsGenTest, ClassofBadTypeFalse) {
   auto elementsType = mlir::RankedTensorType::get({3}, i64Type);
   auto elementsAttr =
       mlir::DenseIntElementsAttr::get(elementsType, ArrayRef<int64_t>{1, 2, 3});
-  mlir::Identifier id = expectedValues.back().first;
+  mlir::StringAttr id = expectedValues.back().first;
   auto wrongAttr = mlir::NamedAttribute(id, elementsAttr);
   newValues.push_back(wrongAttr);
 

diff  --git a/mlir/utils/gdb-scripts/prettyprinters.py b/mlir/utils/gdb-scripts/prettyprinters.py
index 84a9a4590b37b..b495b7cee01ba 100644
--- a/mlir/utils/gdb-scripts/prettyprinters.py
+++ b/mlir/utils/gdb-scripts/prettyprinters.py
@@ -3,20 +3,6 @@
 import gdb.printing
 
 
-class IdentifierPrinter:
-  """Prints an mlir::Identifier instance."""
-
-  def __init__(self, val):
-    self.entry = val['entry']
-
-  def to_string(self):
-    ptr = (self.entry + 1).cast(gdb.lookup_type('char').pointer())
-    return ptr.string(length=self.entry['keyLength'])
-
-  def display_hint(self):
-    return 'string'
-
-
 class StoragePrinter:
   """Prints bases of a struct and its fields."""
 
@@ -159,8 +145,6 @@ def children(self):
 
 pp = gdb.printing.RegexpCollectionPrettyPrinter('MLIRSupport')
 
-pp.add_printer('mlir::Identifier', '^mlir::Identifier$', IdentifierPrinter)
-
 # Printers for types deriving from AttributeStorage or TypeStorage.
 pp.add_printer('mlir::detail::FusedLocationStorage',
                '^mlir::detail::FusedLocationStorage',


        


More information about the Mlir-commits mailing list