Skip to content

Conversation

@merykitty
Copy link
Member

@merykitty merykitty commented Dec 1, 2025

Hi,

Currently, Node::adr_type is ambiguous. For some, it refers to the memory the node consumes, while for the others, it refer to the memory the node produces. This PR removes that ambiguity by introducing Node::in_adr_type and Node::out_adr_type that refer to those properties, respectively. It also introduces a local verification of the memory graph during compilation. These additions uncover some issues:

  • Sometimes, the memory is wired incorrectly, such as in LibraryCall::extend_setCurrentThread, the Phi collect the StoreNodes instead of the whole memory state. I think these issues do not result in crashes or miscompilation, though.
  • AryEqNode reports adr_type being TypeAryPtr::BYTES (it inherits this from StrIntrinsicNode). This is incorrect, however, as it can accept char[] inputs, too.
  • For nodes such as StrInflatedCopyNode, as it consumes more than it produces, during scheduling, we need to compute anti-dependencies. This is not the case, so I fixed it by making it kill all the memory it consumes.
  • GraphKit::set_output_for_allocation uses a raw ProjNode as the base for a MergeMem, this is really suspicious. I didn't fix it, as it seems to not result in any symptom at the moment.

In the end, the execution of the compiler is strictly more restricted than before, and there is less room for ambiguity.

Please take a look and leave your reviews, thanks a lot.


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-8372779: C2: Disambiguate Node::adr_type for the IR graph (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28570

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 1, 2025

👋 Welcome back qamai! 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 Dec 1, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title JDK-8372779: C2: Disambiguate Node::adr_type for the IR graph 8372779: C2: Disambiguate Node::adr_type for the IR graph Dec 1, 2025
@openjdk
Copy link

openjdk bot commented Dec 1, 2025

@merykitty The following labels will be automatically applied to this pull request:

  • graal
  • hotspot
  • shenandoah

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 1, 2025
@mlbridge
Copy link

mlbridge bot commented Dec 1, 2025

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant