-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8319700: [AArch64] C2 compilation fails with "Field too big for insn" #16780
Conversation
👋 Welcome back aboldtch! A progress list of the required criteria for merging this PR into |
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.
That looks like a reasonable thing to do. In C2 elsewhere we use assembler relaxation to allow the use of TB
x even in large methods, but this is good enough for now.
@xmas92 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 63 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 |
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 to me too.
It would be nice if the branch shortening for these stubs could be done as some fixpoint iteration. Or take part when laying out the blocks, as maybe even more branches could be shortened if all the BarrierStubs were not at the very end. Thanks for the reviews. /integrate |
Going to push as commit 3787ff8.
Your commit was automatically rebased without conflicts. |
/backport jdk21u |
@xmas92 the backport was successfully created on the branch xmas92-backport-3787ff8d in my personal fork of openjdk/jdk21u. To create a pull request with this backport targeting openjdk/jdk21u:master, just click the following link: The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:
If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u:
|
Probably not worth making the effort for AArch64, because even the short branches are fairly long, so it takes quite a lot of work to find cases where they're exceeded. The few cases where it might help are rare indeed. |
Not all ZGC C2 BarrierStubs used on aarch64 participates in the laying out of trampoline stubs. (Used enable as many
tbX
instructions as possible.) This leads to to incorrect calculations which may cause the target offset for thetbX
branch to become to large.This fix changes all the BarriesStubs to stubs which participates in the trampoline logic.
Until more platforms requires specialised barrier stub layouts it is not worth adding better support for this pattern. Without a redesign it does make it harder to ensure that this is used correctly. For now the shared code asserts when building for aarch64 that the general shared stubs are not used directly. But care would still have to be taken if any new barrier stubs are introduced.
The behaviour was more easily reproducible when large inlining heuristics. This flag combination was used to get somewhat reliable reproducibility
-esa -ea -XX:MaxInlineLevel=300 -XX:MaxInlineSize=1100 -XX:MaxTrivialSize=1000 -XX:LiveNodeCountInliningCutoff=1000000 -XX:MaxNodeLimit=3000000 -XX:NodeLimitFudgeFactor=600000 -XX:+UnlockExperimentalVMOptions -XX:+UseVectorStubs
There was also an observation inside the JBS comments that there where no
tbX
instructions branching to the emitted trampolines. However I was unable to reproduce this. Ran all tests with the following guarantee, this could not observe it either.linux-aarch64
,linux-aarch64-debug
,macosx-aarch64
,macosx-aarch64-debug
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16780/head:pull/16780
$ git checkout pull/16780
Update a local copy of the PR:
$ git checkout pull/16780
$ git pull https://git.openjdk.org/jdk.git pull/16780/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16780
View PR using the GUI difftool:
$ git pr show -t 16780
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16780.diff
Webrev
Link to Webrev Comment