-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[BOLT][NFCI] Use heuristic for matching split global functions #90429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BOLT][NFCI] Use heuristic for matching split global functions #90429
Conversation
Created using spr 1.3.5 [skip ci]
Created using spr 1.3.5
@llvm/pr-subscribers-llvm-binary-utilities @llvm/pr-subscribers-bolt Author: Amir Ayupov (aaupov) ChangesThere should be no functional change, only faster fragment matching for Test Plan: NFC Full diff: https://github.com/llvm/llvm-project/pull/90429.diff 1 Files Affected:
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;
|
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
f94b275
to
72bf9f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
…90429) This change speeds up fragment matching for large BOLTed binaries where all fragments of global parent functions are put under `bolt-pseudo.o` file symbol: - before: iterating over symbols under `bolt-pseudo.o` only to fail to find a parent, - after: bail out immediately and use a global parent by name. Test Plan: NFC, updated register-fragments-bolt-symbols.s
This change speeds up fragment matching for large BOLTed binaries where
all fragments of global parent functions are put under
bolt-pseudo.o
file symbol:
bolt-pseudo.o
only to failto find a parent,
Test Plan: NFC, updated register-fragments-bolt-symbols.s