-
Notifications
You must be signed in to change notification settings - Fork 176
8387252: [lworld] LoadFlattenedArrayStub may not consider the spill inserted by RA #2579
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
Closed
+10
−3
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Shouldn't the
rlock_resultjust above in line 2381 do exactly that?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 think we need to detect spills in conditional code at compile time.
I'm not convinced creating a new virtual register for "load_result" here is correct either. It moves the problem to a different virtual register, one that has a shorter lifetime that "result", but does that guarantee there won't be a spill? We are still setting a register in two different paths that are invisible to C1 LIR.
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 agree with Dean. I think it's the same problem I described in JDK-8353851.
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.
Maybe setting
LIRGenerator::set_in_conditional_codehere like we do as mitigation in Load/StoreIndexed would help?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.
@dean-long @TobiHartmann Hi, I'm so sorry for being late.
I think this is the same issue as JDK-8353851.
I will try this fix.
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.
Hi Tobias,
I tried this fix, but it didn't solve the current problem(Maybe I misunderstood something). The program still crashed.
If you have a better fix suggestion, i'd be happy to try it out.
fix patch:
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.
Ah, right, I got confused here. This is the same place where we already added
set_in_conditional_codeto mitigate the issue. As JDK-8353851 explains, we were suspecting that this is not sufficient. The issue you are now observing proves that this is true - unfortunately. Any luck coming up with a reproducer on x64 / AArch64?So we need a proper fix for JDK-8353851. @mhaessig did some prototyping there and might have some more details to share but I think it boils down to adding some kind of macro node to LIR that is expanded "late" so that the register allocator can not add spilling in-between. I.e. avoid branching in the LIR altogether.
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.
Also, what about closing this as duplicate of JDK-8353851 so that we don't track the same thing twice?
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.
Sure if we think this is a duplicate of JDK-8353851. Let me close this.