[llvm] [NFC] Use more efficient data structures in SubtargetEmitter (PR #102090)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 05:43:36 PDT 2024


================
@@ -260,7 +260,7 @@ unsigned SubtargetEmitter::FeatureKeyValues(
   llvm::sort(FeatureList, LessRecordFieldName());
 
   // Check that there are no duplicate keys
-  std::set<StringRef> UniqueKeys;
+  llvm::StringSet<> UniqueKeys;
----------------
jurahul wrote:

My understanding is that unordered containers are generally more efficient, and in this case we do not iterate over the set or map, so ordering is not required. That's the motivation. I tried unorderd_set<StringRef> but that did not work, so switched to StringSet<>.

https://github.com/llvm/llvm-project/pull/102090


More information about the llvm-commits mailing list