-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8345801: C2: Clean up include statements to speed up compilation when touching type.hpp #22658
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 chagedorn! A progress list of the required criteria for merging this PR into |
|
@chhagedorn 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 42 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 |
|
@chhagedorn The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
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.
Good.
| return arr->at(block_idx) + (idx & (_node_notes_block_size-1)); | ||
| } | ||
|
|
||
| inline Node_Notes* Compile::node_notes_at(int idx) { |
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.
It seems weird to have these inlined Compile methods in node.hpp. Could we clean this up separately, maybe by moving them to compile.inline.hpp?
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.
I was confused about that as well. There is currently no compile.inline.hpp but maybe we should introduce one for such cases. I can file an RFE to clean this up separately.
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, as long as you tested w/ and w/o precompiled headers.
|
Thanks @vnkozlov and @dean-long for your reviews!
That's a good point. I thought it was covered by our CI but I've run now a separate testing with |
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.
It takes just 7 minutes to compile and link HotSpot for you? If only I had that kind of luxury...
|
Thanks @TheShermanTanker for your review! The measured numbers are only when starting a hotspot build again after touching |
|
/integrate |
|
Going to push as commit 32c8195.
Your commit was automatically rebased without conflicts. |
|
@chhagedorn Pushed as commit 32c8195. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
I've noticed that after touching
type.hppin Valhalla, it requires more than 7 minutes to build hotspot again on my machine. I would have suspected that we mostly recompile C2/opto source files. But that is far from the truth: A lot of unrelated source files must be recompiled, including, for example, C1, JFR, or runtime files.In mainline, the impact is not that severe. But it still requires around 1 minute to build hotspot again on my machine after touching
type.hpp. I've had a look at the include chains and removed quite a lot of unused includes. For the active includes, the most impact had includingoutput.hppinsidec2compiler.hpp. This set up the following dependency chain:This means that a lot of C1 files also need to be re-compiled as well as some more source file that include
compiler/compilerDefinitions.inline.hpp. I cut this dependency chain by removing the include ofopto/output.hppinopto/c2compiler.hppand moved the constantinitial_const_capacityfromoutput.hpptoc2Compiler.hppwhich seemed to be the only reason why we have the include in place. After this change, I was required to add some missing includes that were included transitively before.The final mainline patch could also be applied to the current Valhalla repository (with some small tweaks). The results were quite promising. I could bring the compilation time on my machine significantly down in mainline and especially in Valhalla after touching
type.hpp:I've only focused on
type.hpphere but I guess other includes in the JIT compiler area or other parts of hotspot could also be revisited to possibly speed up the compilation after touching some header files.Testing:
Thanks,
Christian
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22658/head:pull/22658$ git checkout pull/22658Update a local copy of the PR:
$ git checkout pull/22658$ git pull https://git.openjdk.org/jdk.git pull/22658/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22658View PR using the GUI difftool:
$ git pr show -t 22658Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22658.diff
Using Webrev
Link to Webrev Comment