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
JDK-8277496 Remove duplication in c1 Block successor lists #6614
JDK-8277496 Remove duplication in c1 Block successor lists #6614
Conversation
create separate versions for two cases _end == NULL, _end != NULL. This makes it explicit that the former case is only ever used in GraphBuilder (and in the printer). GraphBuilder accessor methods for _successors: In preparation for creating a temporary list of lists in graphbuilder
This makes it clear how weird this is. The nonnull case doesnt even set begin!
|
@LudwikJaniuk The following label 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 list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
@@ -3338,6 +3393,10 @@ GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope) | |||
#ifndef PRODUCT | |||
if (PrintCompilation && Verbose) tty->print_cr("Created %d Instructions", _instruction_count); | |||
#endif | |||
|
|||
// JANIUK: If we iterate all the blocks in _blocks, some of them have end NULL. |
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.
Left over comment?
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.
Indeed! Removed it
src/hotspot/share/c1/c1_LIR.cpp
Outdated
@@ -1586,6 +1586,7 @@ static void print_block(BlockBegin* x) { | |||
} | |||
} | |||
|
|||
if (end != NULL) |
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.
Missing braces on if statement
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.
Corrected it
@LudwikJaniuk This change now passes all automated pre-integration checks. 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 96 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@neliasso, @vnkozlov) but any other Committer may sponsor as well.
|
/integrate |
@LudwikJaniuk |
@LudwikJaniuk Please, rerun your testing. Running only -b linux-x64
is not enough - you should not specify this option at all. Testing should be done on all platforms. Also linux-x64
is product build which does not include asserts. So we may not catch possible issues.
/sponsor |
Going to push as commit 8d190dd.
Your commit was automatically rebased without conflicts. |
@neliasso @LudwikJaniuk Pushed as commit 8d190dd. |
Remove
BlockBegin::_successors
, leavingBlockEnd::_sux
as the SSOT for the successors of a block. Prior to this PR, these two lists were both tracking the same list of successors of the same block. This necessitated a lot of syncing and verification code.With this PR, as long as a block has its end pointer assigned, its successors can always be reached by querying the
BlockEnd
.BlockEnd::_sux
becomes the single place where the list of successors is maintained. When modified, the successor list no longer needs to be synchronized in two places, reducing complexity and confusion. Asserts on the two lists corresponding no longer need to be made.While being created in
GraphBuilder
,BlockBegin
s don't have aBlockEnd
assigned yet. To temporarily track block successors in this small interval, add a lookup structureBlockListBuilder::_bci2block_successors
.This PR affects debug printing code. If the end pointer of a
BlockBegin
is NULL for some reason, then the successor list can no longer be printed (for obious reasons).This PR introduces an additional check to IR::verify to check that
BlockBegin::_end
is not set to null.This PR also performs some minor refactoring, polishing, inlining, and removing of dead code around the affected areas.
The commit history has been polished to attempt to guide the reader through the changes.
hs-tier1 and hs-tier2 tests pass.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6614/head:pull/6614
$ git checkout pull/6614
Update a local copy of the PR:
$ git checkout pull/6614
$ git pull https://git.openjdk.java.net/jdk pull/6614/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6614
View PR using the GUI difftool:
$ git pr show -t 6614
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6614.diff