-
Notifications
You must be signed in to change notification settings - Fork 109
8335256: [lworld] C2: Remove larval InlineTypeNode #1447
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
base: lworld
Are you sure you want to change the base?
Conversation
/issue 8325627 |
👋 Welcome back qamai! A progress list of the required criteria for merging this PR into |
@merykitty 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 no new commits pushed to the As you do not have Committer status in this project an existing Committer must agree to sponsor your change. ➡️ To flag this PR as ready for integration with the above commit message, type |
@merykitty |
@merykitty |
Webrevs
|
Great work @merykitty! Thanks a lot for the investigation. When working on the new value object construction model, I was concerned that we might end up with adding identity back to the larvals but I was still naively hoping that we could get around that. Looks like we can't. Maybe you could change the title to something more descriptive for future reference / search. I run this through testing and there are a few issues:
|
@TobiHartmann Thanks a lot for the comprehensive testing, it is really helpful.
This one fails because after removal of some allocations, not only other allocations become eligible for elimination, locks can also be eliminated. As a result, we need to do the whole macro elimination again. I noticed that
This one is an oversight by me. When exiting a constructor, the larval oop is aggressively replaced by the non-larval one in all the frames. This relies on the assumption that all blocks in which the oop is larval has been processed. This is incorrect when we have uncommon traps, which can be processed at any time. As a result, we can only replace the larval oop with the non-larval one in the current frame.
I modified the test to push everything into the local slots, 2 distinct slots are present into the loop, keep the original intention of the test.
This is interesting. This is an oversight from #1424. The issue is that it is hard to decide that 2 nodes are definitely different or definitely the same, especially when the graph may be non-canonical during IGVN. As a result, I resort to a more conservative approach there:
|
Thanks for quickly fixing these issues. I ran another round of testing and there's only one issue left:
|
@TobiHartmann The failure was due to the fact that |
Hi
The root issue is that a larval value object is fundamentally different from a non-larval one. The most important thing is that it has a unique identity and it expects any modification on 1 reference observable by all other equivalent references. As a result, we need a mechanism to track the identity of a larval object, which
InlineTypeNode
does not provide. My current proposal to fix this issue is to abandon larvalInlineTypeNode
s and use the oop like other objects.It is probably beneficial to have another mechanism to make it easier optimizing larval inline type nodes, but I think it can be a follow-up RFE.
An example regarding the issue with tracking the identity of a larval InlineTypeNode:
Consider this pseudobytecode sequence:
There are 2 equivalent references in the stack at the loop entry. When
Parse::merge
encounters them, it cannot know that these are the same because the back-edge has not been processed yet. As a result, it creates 2 separatePhi
s for these references. Then,invokespecial
will only make the top of the stack a non-larval object, not the next one, which is the one returned to the caller. As a result, we fail withassert(!value->is_InlineType() || !value->as_InlineType()->is_larval(), "returning a larval")
. Worse, if the method is osr-compiled at the loop head, we have 2 separate references fed into the compiled function and there is no way we may know that they are of the same object.Please take a look and leave your reviews, thanks a lot.
Progress
Issues
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1447/head:pull/1447
$ git checkout pull/1447
Update a local copy of the PR:
$ git checkout pull/1447
$ git pull https://git.openjdk.org/valhalla.git pull/1447/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1447
View PR using the GUI difftool:
$ git pr show -t 1447
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1447.diff
Using Webrev
Link to Webrev Comment