[llvm-branch-commits] [BOLT][NFCI] Use heuristic for matching split global functions (PR #90429)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Apr 28 21:05:37 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-bolt

Author: Amir Ayupov (aaupov)

<details>
<summary>Changes</summary>

There should be no functional change, only faster fragment matching for
large BOLTed binaries where all fragments of global parent functions
are put under bolt-pseudo.o file symbol.

Test Plan: NFC


---
Full diff: https://github.com/llvm/llvm-project/pull/90429.diff


1 Files Affected:

- (modified) bolt/lib/Rewrite/RewriteInstance.cpp (+5) 


``````````diff
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index 8eb2e5a9d9120a..d92775e16b7cf1 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -1511,6 +1511,11 @@ void RewriteInstance::registerFragments() {
 
     uint64_t ParentAddress{0};
 
+    // Check if containing FILE symbol is BOLT emitted synthetic symbol marking
+    // local fragments of global parents.
+    if (cantFail(FSI[-1].getName()) == getBOLTFileSymbolName())
+      goto registerParent;
+
     // BOLT split fragment symbols are emitted just before the main function
     // symbol.
     for (ELFSymbolRef NextSymbol = Symbol; NextSymbol < StopSymbol;

``````````

</details>


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


More information about the llvm-branch-commits mailing list