[llvm] [BOLT][NFC] Make YamlProfileToFunction a DenseMap (PR #108712)

Amir Ayupov via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 15:09:23 PST 2024


================
@@ -105,7 +105,7 @@ class YAMLProfileReader : public ProfileReaderBase {
   yaml::bolt::BinaryProfile YamlBP;
 
   /// Map a function ID from a YAML profile to a BinaryFunction object.
-  std::vector<BinaryFunction *> YamlProfileToFunction;
+  DenseMap<uint32_t, BinaryFunction *> YamlProfileToFunction;
----------------
aaupov wrote:

But the YamlBF.Id is uint32, so I decided to match it: https://github.com/llvm/llvm-project/blob/6b21cf8ccad84e2670e458d8bdaccbd0ae37b46b/bolt/include/bolt/Profile/ProfileYAMLMapping.h#L200-L203

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


More information about the llvm-commits mailing list