8381872: C2: assert before block local scheduling failed with UseCompactObjectHeaders#30762
8381872: C2: assert before block local scheduling failed with UseCompactObjectHeaders#30762rkennke wants to merge 2 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back rkennke! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
mhaessig
left a comment
There was a problem hiding this comment.
I tested up to tier4 for for -UCOH and up to tier6 for +UCOH and everything passed.
|
Is it necessary that the base input of a |
| } | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
I experimented with this so I could understand it better, and something seems to be off. The above code disables the optimization even if the only dependant_lea is the lone lea_derived_oop, in which case it would seem to be OK because we aren't replacing the base with a "new base".
Also, I tried disabling the above change, and the test below still passes.
| Node* dependant_lea = decode->fast_out(i); | ||
| if (dependant_lea->is_Mach() && dependant_lea->as_Mach()->ideal_Opcode() == Op_AddP) { | ||
| dependant_lea->set_req(AddPNode::Base, lea_derived_oop->in(AddPNode::Address)); | ||
| dependant_lea->set_req(AddPNode::Base, new_base); |
There was a problem hiding this comment.
Is it necessary that the base input of a leaP... is non-null? Given that the leaP... does not appear in an oop map, can we make the base input nullptr, so we don't need to worry about register conflict anymore?
You are absolutely right, @merykitty. The AddPNode::Base is only for the oop map and does not even get matched. This peephole is for cleaning up decodes that nevver get used in an oop map so rewiring is not even necessary. I wish I had thought of this a year ago...
The following does the trick (inspired by AddPNode::make_off_heap since using nullptr does not work):
| dependant_lea->set_req(AddPNode::Base, new_base); | |
| dependant_lea->set_req(AddPNode::Base, Compile::current()->top()); |
By not introducing a dependency, there will also not be a conflict.
This fixes a bug in Peephole::lea_remove_redundant() in peephole_x86_64.cpp, which can lead to miscompilations caused by two distinct values getting assigned to the same register.
Testing:
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30762/head:pull/30762$ git checkout pull/30762Update a local copy of the PR:
$ git checkout pull/30762$ git pull https://git.openjdk.org/jdk.git pull/30762/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 30762View PR using the GUI difftool:
$ git pr show -t 30762Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30762.diff
Using Webrev
Link to Webrev Comment