[llvm] [BOLT] Use symbol table info in registerFragment (PR #89648)

Amir Ayupov via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 20:28:26 PDT 2024


================
@@ -1417,50 +1418,125 @@ void RewriteInstance::registerFragments() {
   if (!BC->HasSplitFunctions)
     return;
 
+  // Process fragments with ambiguous parents separately as they are typically a
+  // vanishing minority of cases and require expensive symbol table lookups.
+  std::vector<std::pair<StringRef, BinaryFunction *>> AmbiguousFragments;
   for (auto &BFI : BC->getBinaryFunctions()) {
     BinaryFunction &Function = BFI.second;
     if (!Function.isFragment())
       continue;
-    unsigned ParentsFound = 0;
     for (StringRef Name : Function.getNames()) {
       StringRef BaseName, Suffix;
       std::tie(BaseName, Suffix) = Name.split('/');
       const size_t ColdSuffixPos = BaseName.find(".cold");
----------------
aaupov wrote:

Suffix is used to determine if a given fragment name is a local symbol. How can I check it otherwise?

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


More information about the llvm-commits mailing list