Skip to content

8390813: C2: Wrong entries in adlc commutative op lists - #32476

Open
DingliZhang wants to merge 2 commits into
openjdk:masterfrom
DingliZhang:JDK-8390813
Open

8390813: C2: Wrong entries in adlc commutative op lists#32476
DingliZhang wants to merge 2 commits into
openjdk:masterfrom
DingliZhang:JDK-8390813

Conversation

@DingliZhang

@DingliZhang DingliZhang commented Aug 21, 2026

Copy link
Copy Markdown
Member

Hi, please consider.

MatchNode::count_commutative_op() in src/hotspot/share/adlc/formssel.cpp holds two lists
of ideal node names that adlc treats as commutative. Neither is correct.

The scalar list is missing a comma:

"XorI","XorL"
"UMax","UMin"

String literal concatenation folds "XorL" "UMax" into "XorLUMax", so the list really is
{..., "XorI", "XorLUMax", "UMin"}. As entries are compared with strcmp(), XorL is no
longer recognized and adlc stops generating its operand-swapped match rules.

There are also no scalar UMax/UMin ideal nodes; classes.hpp only defines UMinV/UMaxV.
So the same two names in commut_vector_op_list never match either.



Progress

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

Issue

  • JDK-8390813: C2: Wrong entries in adlc commutative op lists (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32476

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Aug 21, 2026

Copy link
Copy Markdown

👋 Welcome back dzhang! 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

openjdk Bot commented Aug 21, 2026

Copy link
Copy Markdown

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

@openjdk openjdk Bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Aug 21, 2026
@openjdk

openjdk Bot commented Aug 21, 2026

Copy link
Copy Markdown

@DingliZhang 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 commented Aug 21, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-compiler. This can be overridden with the /reviewers command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Aug 21, 2026
@mlbridge

mlbridge Bot commented Aug 21, 2026

Copy link
Copy Markdown

Webrevs

Comment thread src/hotspot/share/adlc/formssel.cpp Outdated
@dean-long

Copy link
Copy Markdown
Member

It would be really nice if the node types or maybe the rules themselves knew if they were commutative or not, instead of having to do string compares, but I guess that's out of the scope of this fix.

@merykitty merykitty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, I have submitted the test.

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 rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants