-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[cling] Reuse existing weak symbols, also from JIT: #12018
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
[cling] Reuse existing weak symbols, also from JIT: #12018
Conversation
|
Starting build on |
|
Starting build on |
|
Build failed on ROOT-ubuntu18.04/nortcxxmod. Errors:
|
|
Build failed on mac12/noimt. Errors:
|
|
Build failed on ROOT-performance-centos8-multicore/cxx17. Errors:
|
5c7cf42 to
fc5fe41
Compare
|
Starting build on |
|
Build failed on ROOT-ubuntu18.04/nortcxxmod. Errors:
|
|
Build failed on mac12/noimt. Errors:
|
|
Build failed on ROOT-debian10-i386/soversion. Errors:
|
|
With this we go from 141 Billion instructions (pre-llvm-13, i.e. llvm-9) to 134B instr with llvm13, for |
|
Build failed on ROOT-performance-centos8-multicore/cxx17. Errors:
|
|
Build failed on windows10/cxx14. Errors:
|
|
Build failed on mac11/cxx14. Errors:
|
|
Build failed on ROOT-ubuntu2004/python3. Errors:
|
fc5fe41 to
c313072
Compare
|
Starting build on |
c313072 to
a465470
Compare
|
Starting build on |
|
Build failed on ROOT-ubuntu18.04/nortcxxmod. Errors:
|
|
Build failed on ROOT-debian10-i386/soversion. Errors:
|
|
Build failed on mac11/cxx14. Errors:
|
259d703 to
f47e127
Compare
|
Starting build on |
|
Build failed on windows10/cxx14. Errors:
|
|
Build failed on ROOT-debian10-i386/soversion. Failing tests: |
|
Build failed on mac11/cxx14. Failing tests:
And 623 more |
With the upgrade to llvm-13, the JIT lost the ability to re-use existing weak symbols that the JIT had already emitted, instead only looking at dlsym. This causes a significant increase in JITted symbols, and thus a significant slow-down of cling / its JIT. This restores the old behavior, with an identical set of symbols that jet jitted.
Small functions might get inlined, and hiding their definition prevents the inliner from doing its job.
m_JIT.getSymbolAddress() invokes the symbol materializers, which compile (which is sort of okay) but also try autoloading (which totally is not okay). Instead, implement a function to search existing JIT symbols. This can be accelerated by looking up the whole set of symbols, instead of doing it symbol by symbol. I leave that refactoring for later...
f47e127 to
ba2f10e
Compare
|
Starting build on |
|
Update on #12018 (comment) : currently 141B instr => 130B instr |
|
Build failed on windows10/cxx14. Failing tests: |
|
@phsft-bot build just on windows10/cxx14, mac12/noimt |
|
Starting build on |
|
Build failed on windows10/cxx14. Failing tests: |
Without, the JIT fails to compile roottest/root/aclic/misc/assertROOT7027.C correctly.
|
Starting build on |
hahnjo
left a comment
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.
Looks good and seems to pass tests on Linux and macOS. IMO it would be fantastic to reorder / squash the commits to make all intermediate states work fine (especially the last commit is fixing failures and also "find existing weak symbol without materializer:" seems important), but up to you.
The main reason why I like the current small-ish steps (even if it breaks intermediate commits at the cost of more fragile bijection) is that I will certainly be asking myself, "why did I not do this differently" in some months, and having the commit that explains why e.g. I switched from "just ask the JIT for symbols" to "look for symbol names" is extra information. Same for the final Windows "fix", for instance - it's a very distinct / separate step. Does that make sense? |
|
Merged by hand, leaving a |
|
v6-28: #12163 |
With the upgrade to llvm-13, the JIT lost the ability to re-use existing weak symbols that the JIT had already emitted, instead only looking at dlsym. This causes a significant increase in JITted symbols, and thus a significant slow-down of cling / its JIT.
This restores the old behavior, with an identical set of symbols that jet jitted.
This Pull request:
Changes or fixes:
Checklist:
This PR fixes #