Skip to content

Conversation

@dlunde
Copy link
Member

@dlunde dlunde commented Apr 28, 2025

Issue Summary

The current documentation for PhaseCFG::insert_anti_dependences is difficult to follow and sometimes even misleading. We should ensure the method is appropriately documented.

Changeset

  • Rename PhaseCFG::insert_anti_dependences to PhaseCFG::raise_above_anti_dependences. The purpose of PhaseCFG::raise_above_anti_dependences is twofold: raise the load's LCA so that the load is scheduled before anti-dependent stores, and if necessary add anti-dependence edges between the load and certain anti-dependent stores (to ensure we later "raise" the load before anti-dependent stores in LCM). The name PhaseCFG::insert_anti_dependences suggests that we only add anti-dependence edges. The name PhaseCFG::raise_above_anti_dependences, therefore, seems more appropriate.
  • Significantly add to and revise the source code documentation of PhaseCFG::raise_above_anti_dependences.
  • Add, move, and revise asserts in PhaseCFG::raise_above_anti_dependences, including improved assert messages in a few places.
  • In the main worklist loop of PhaseCFG::raise_above_anti_dependences:
    • Clean up how we identify the search root (avoid mutation).
    • Add a missing early exit for Phi nodes when LCA == early.

Testing

  • GitHub Actions
  • tier1 to tier4 (and additional Oracle-internal testing) on Windows x64, Linux x64, Linux aarch64, macOS x64, and macOS aarch64.

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8351568: Improve source code documentation for PhaseCFG::insert_anti_dependences (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24926/head:pull/24926
$ git checkout pull/24926

Update a local copy of the PR:
$ git checkout pull/24926
$ git pull https://git.openjdk.org/jdk.git pull/24926/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24926

View PR using the GUI difftool:
$ git pr show -t 24926

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24926.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 28, 2025

👋 Welcome back dlunden! 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 Apr 28, 2025

@dlunde 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:

8351568: Improve source code documentation for PhaseCFG::insert_anti_dependences

Reviewed-by: rcastanedalo, chagedorn

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

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 changed the title 8351568 8351568: Improve source code documentation for PhaseCFG::insert_anti_dependences Apr 28, 2025
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 28, 2025
@openjdk
Copy link

openjdk bot commented Apr 28, 2025

@dlunde 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 pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Apr 28, 2025
@mlbridge
Copy link

mlbridge bot commented Apr 28, 2025

Copy link
Contributor

@galderz galderz left a comment

Choose a reason for hiding this comment

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

Thanks @dlunde for the PR. Some small comments.

Copy link
Contributor

@robcasloz robcasloz left a comment

Choose a reason for hiding this comment

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

Thanks for doing this, Daniel! insert_anti_dependences is indeed easier to understand after your proposed cleanups and additional comments. I have a few questions and suggestions.

Please update also the reference to insert_anti_dependencies in src/hotspot/share/adlc/output_h.cpp.

@dlunde
Copy link
Member Author

dlunde commented May 8, 2025

Thanks for doing this, Daniel! insert_anti_dependences is indeed easier to understand after your proposed cleanups and additional comments. I have a few questions and suggestions.

Thanks for the review @robcasloz!

Please update also the reference to insert_anti_dependencies in src/hotspot/share/adlc/output_h.cpp.

Good catch, I only grepped for insert_anti_dependences 🙂

Copy link
Contributor

@robcasloz robcasloz left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my comments, looks good! I just have an (optional) suggestion (https://github.com/openjdk/jdk/pull/24926/files#r2081235028).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 9, 2025
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label May 9, 2025
Copy link
Contributor

@robcasloz robcasloz 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 (modulo the grammar glitch), thanks!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 9, 2025
Co-authored-by: Roberto Castañeda Lozano <robcasloz@users.noreply.github.com>
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label May 9, 2025
@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 12, 2025
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.

Nice documentation! A lot of minor comments/suggestions while reading through the comments in the entire method.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label May 15, 2025
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.

Thanks for doing all the updates, looks good to me now!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 15, 2025
@dlunde
Copy link
Member Author

dlunde commented May 15, 2025

Thanks for the reviews @robcasloz and @chhagedorn! Only documentation changes since the initial PR commit, and GHA is clean after aec59a1. Integrating now.

/integrate

@openjdk
Copy link

openjdk bot commented May 15, 2025

Going to push as commit 5cb2317.
Since your change was applied there have been 316 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 15, 2025
@openjdk openjdk bot closed this May 15, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 15, 2025
@openjdk
Copy link

openjdk bot commented May 15, 2025

@dlunde Pushed as commit 5cb2317.

💡 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.

6 participants