Skip to content

8253524: C2: Refactor code that clones predicates during loop unswitching #317

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
wants to merge 5 commits into from

Conversation

rwestrel
Copy link
Contributor

@rwestrel rwestrel commented Sep 23, 2020

During unswitching, PhaseIdealLoop::create_slow_version_of_loop()
calls PhaseIdealLoop::clone_predicates_to_unswitched_loop() twice, one
for each loops, to clone some predicates above each loop. That code is
fragile as it (implicitly) requires the fast loop to be processed
first. I propose calling
PhaseIdealLoop::clone_predicates_to_unswitched_loop() a single time
and have it handle both loops in a single pass.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8253524: C2: Refactor code that clones predicates during loop unswitching

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/317/head:pull/317
$ git checkout pull/317

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 23, 2020

👋 Welcome back roland! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 23, 2020

@rwestrel The following label will be automatically applied to this pull request: hotspot-compiler.

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 (add|remove) "label" command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Sep 23, 2020
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 23, 2020
@mlbridge
Copy link

mlbridge bot commented Sep 23, 2020

Webrevs

Copy link
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice clean-up! This makes it much easier. Apart from some minor code style comments, it looks good to me!

ProjNode* new_predicate_proj, bool is_slow_loop, uint idx_before_clone,
Node_List &old_new) {
assert(old_predicate_proj->is_Proj(), "must be projection");
void PhaseIdealLoop::clone_skeleton_predicates_to_unswitched_loop(IdealLoopTree *loop, const Node_List &old_new, Deoptimization::DeoptReason reason,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asterisk: IdealLoopTree*

Comment on lines 1434 to 1438
void clone_predicates_to_unswitched_loop(IdealLoopTree *loop, const Node_List &old_new, ProjNode*& iffast, ProjNode*& ifslow);
ProjNode* clone_predicate_to_unswitched_loop(ProjNode* predicate_proj, Node* new_entry, Deoptimization::DeoptReason reason);
void clone_skeleton_predicates_to_unswitched_loop(IdealLoopTree *loop, const Node_List &old_new, Deoptimization::DeoptReason reason,
ProjNode* old_predicate_proj, ProjNode* iffast, ProjNode* ifslow);
void check_created_predicate_for_unswitching(const Node *new_entry) const PRODUCT_RETURN;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the asterisks to the types.

}

#ifndef PRODUCT
void PhaseIdealLoop::check_created_predicate_for_unswitching(const Node *new_entry) const {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asterisk: Node*

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chhagedorn thanks for the review (and offline comments). Should be fixed now.

Copy link
Member

@chhagedorn chhagedorn left a 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!

@openjdk
Copy link

openjdk bot commented Sep 23, 2020

@rwestrel 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 more details.

After integration, the commit message for the final commit will be:

8253524: C2: Refactor code that clones predicates during loop unswitching

Reviewed-by: chagedorn, kvn, thartmann

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 13 new commits pushed to the master branch:

  • c303fd5: 8253581: runtime/stringtable/StringTableCleaningTest.java fails on 32-bit platforms
  • f3ea0d3: 8252583: Clean up unused phi-to-copy degradation mechanism
  • 4440bda: 8219586: CodeHeap State Analytics processes dead nmethods
  • 154b8cf: 8253014: OopStorage bulk release logs entries multiple times
  • ba174af: 8253048: AArch64: When CallLeaf, no need to preserve callee-saved registers in caller
  • 3320fc0: 8253372: [TESTBUG] update tests which require jvmti - hotspot
  • f765a7f: 8252712: move doclint to jdk.javadoc module
  • c21690b: 8253464: ARM32 Zero: atomic_copy64 is incorrect, breaking volatile stores
  • 0bc01da: 8250635: MethodArityHistogram should use Compile_lock in favour of fancy checks
  • 812b39f: 8252739: Deflater.setDictionary(byte[], int off, int len) ignores the starting offset for the dictionary
  • ... and 3 more: https://git.openjdk.java.net/jdk/compare/3fe5886baf93dbbeba7baac4dad5876eeb7f9f5b...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 23, 2020
Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

}
#endif
void PhaseIdealLoop::clone_predicates_to_unswitched_loop(IdealLoopTree* loop, const Node_List& old_new, ProjNode*& iffast, ProjNode*& ifslow) {
LoopNode* head = loop->_head->as_Loop();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra whitespace after head

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove the white space before I integrate the change.

@rwestrel
Copy link
Contributor Author

@chhagedorn @vnkozlov @TobiHartmann thanks for the review

@rwestrel
Copy link
Contributor Author

/test

@openjdk
Copy link

openjdk bot commented Sep 24, 2020

@rwestrel you need to get approval to run the tests in tier1 for commits up until 93f33e9b

@openjdk openjdk bot added the test-request label Sep 24, 2020
@chhagedorn
Copy link
Member

/test approve

@openjdk openjdk bot removed the test-request label Sep 24, 2020
@openjdk
Copy link

openjdk bot commented Sep 24, 2020

A test job has been started with id: github.com-149121954-317-698149552

@openjdk
Copy link

openjdk bot commented Sep 24, 2020

@rwestrel your test job with id github.com-149121954-317-698149552 for commits up until 93f33e9b has finished.

@rwestrel
Copy link
Contributor Author

/test

@openjdk
Copy link

openjdk bot commented Sep 24, 2020

@rwestrel you need to get approval to run the tests in tier1 for commits up until 33fb2fe

@openjdk openjdk bot added the test-request label Sep 24, 2020
@chhagedorn
Copy link
Member

/test approve

@openjdk openjdk bot removed the test-request label Sep 24, 2020
@openjdk
Copy link

openjdk bot commented Sep 24, 2020

A test job has been started with id: github.com-149121954-317-698199487

@openjdk
Copy link

openjdk bot commented Sep 24, 2020

@rwestrel your test job with id github.com-149121954-317-698199487 for commits up until 33fb2fe has finished.

@rwestrel
Copy link
Contributor Author

/integrate

@openjdk openjdk bot closed this Sep 24, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 24, 2020
@openjdk
Copy link

openjdk bot commented Sep 24, 2020

@rwestrel Since your change was applied there have been 13 commits pushed to the master branch:

  • c303fd5: 8253581: runtime/stringtable/StringTableCleaningTest.java fails on 32-bit platforms
  • f3ea0d3: 8252583: Clean up unused phi-to-copy degradation mechanism
  • 4440bda: 8219586: CodeHeap State Analytics processes dead nmethods
  • 154b8cf: 8253014: OopStorage bulk release logs entries multiple times
  • ba174af: 8253048: AArch64: When CallLeaf, no need to preserve callee-saved registers in caller
  • 3320fc0: 8253372: [TESTBUG] update tests which require jvmti - hotspot
  • f765a7f: 8252712: move doclint to jdk.javadoc module
  • c21690b: 8253464: ARM32 Zero: atomic_copy64 is incorrect, breaking volatile stores
  • 0bc01da: 8250635: MethodArityHistogram should use Compile_lock in favour of fancy checks
  • 812b39f: 8252739: Deflater.setDictionary(byte[], int off, int len) ignores the starting offset for the dictionary
  • ... and 3 more: https://git.openjdk.java.net/jdk/compare/3fe5886baf93dbbeba7baac4dad5876eeb7f9f5b...master

Your commit was automatically rebased without conflicts.

Pushed as commit b1e2f02.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants