diff --git a/llvm/include/llvm/Support/AArch64TargetParser.h b/llvm/include/llvm/Support/AArch64TargetParser.h
--- a/llvm/include/llvm/Support/AArch64TargetParser.h
+++ b/llvm/include/llvm/Support/AArch64TargetParser.h
@@ -120,9 +120,12 @@
   ArchInfo &operator=(const ArchInfo &rhs) = delete;
   ArchInfo &&operator=(const ArchInfo &&rhs) = delete;
 
-  // Comparison is done by address. Copies should not exist.
-  bool operator==(const ArchInfo &Other) const { return this == &Other; }
-  bool operator!=(const ArchInfo &Other) const { return this != &Other; }
+  bool operator==(const ArchInfo &Other) const {
+    return this->Name == Other.Name;
+  }
+  bool operator!=(const ArchInfo &Other) const {
+    return this->Name != Other.Name;
+  }
 
   // Defines the following partial order, indicating when an architecture is
   // a superset of another: