-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8304893: Link Time Optimization with gcc can be faster #13180
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
Conversation
👋 Welcome back jwaters! A progress list of the required criteria for merging this PR into |
@TheShermanTanker The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
make/hotspot/lib/JvmFeatures.gmk
Outdated
@@ -169,8 +169,12 @@ ifeq ($(call check-jvm-feature, link-time-opt), true) | |||
# later on if desired | |||
JVM_OPTIMIZATION := HIGHEST_JVM | |||
ifeq ($(call isCompiler, gcc), true) | |||
JVM_CFLAGS_FEATURES += -flto -fuse-linker-plugin | |||
JVM_LDFLAGS_FEATURES += -flto -fuse-linker-plugin -fno-strict-aliasing | |||
JVM_CFLAGS_FEATURES += -flto=$(JOBS) -fuse-linker-plugin -fno-strict-aliasing -fno-fat-lto-objects |
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.
-fno-fat-lto-objects
has been the default for a while now ( at least gcc 10+)
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.
Seems okay. Thanks.
@TheShermanTanker This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 97 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
It would be very helpful if PR description and especially JBS issue could be more specific.
What incorrect options, what exactly changed? This is important to gauge the effect it would have on backports, and whether this issue is important to backport. |
I'll update the description to mention those flags |
/integrate |
Going to push as commit aa76210.
Your commit was automatically rebased without conflicts. |
@TheShermanTanker Pushed as commit aa76210. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
You made a change to the patch just before integrating, on a weekend when most reviewers aren't paying attention. I would probably have argued against that change, as the JOBS setting reflects the concurrency the user has requested, which may very well be less than the number of available hardware threads in the system. I will most likely never use this feature, so it's not important enough to change it back to warrant another bug/PR/review. This is more about the principle of integrating the code as reviewed. |
Ah, sorry about that, I realized at the last moment that the auto option was available just before integration. Will keep that in mind next time |
A previous argument against link time optimization support that we have for gcc is that it was extremely slow. After some checks it turns out we are passing rather inefficient flags to gcc in optimized builds. Changing these flags to run the linker optimizations in parallel and passing additional flags to the compiler have the ability to speed this process up significantly. Also fixes some incorrect flags passed to ld for linking as well, since strict-aliasing is required for both linker and compiler, and the same optimization level should be specified instead of letting the default -O1 be passed to the linker
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13180/head:pull/13180
$ git checkout pull/13180
Update a local copy of the PR:
$ git checkout pull/13180
$ git pull https://git.openjdk.org/jdk.git pull/13180/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13180
View PR using the GUI difftool:
$ git pr show -t 13180
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13180.diff