Skip to content

8388858: C2: Add UseLoopLimitCheckPredicate and UseParsePredicates flags - #32233

Open
chhagedorn wants to merge 1 commit into
openjdk:masterfrom
chhagedorn:JDK-8388858
Open

8388858: C2: Add UseLoopLimitCheckPredicate and UseParsePredicates flags#32233
chhagedorn wants to merge 1 commit into
openjdk:masterfrom
chhagedorn:JDK-8388858

Conversation

@chhagedorn

@chhagedorn chhagedorn commented Aug 6, 2026

Copy link
Copy Markdown
Member

We have flag switches for all predicates - except for Loop Limit Check Predicates. It is sometimes useful to also disable these for debugging or testing purposes to not create a Parse Predicate for them which means that we cannot create Loop Limit Check Predicates.

With that in place, it would also be useful to disable all Parse Predicates together. This is especially useful for debugging to simplify a graph. But it's also useful to simulate a situation where no Parse Predicates remain above a loop head. This could happen, for example, when partially peeling a loop (the Parse Predicates are above the partially peeled section and not above the loop head anymore and are thus removed) or when we trapped already and then no longer emit a Parse Predicate.

This patch proposes both flags:

  • UseLoopLimitCheckPredicate: Disable Loop Limit Check Predicate creation.
  • UseParsePredicates: Disables all Parse Predicates from being emitted.
    • When setting this flag to false, I automatically set all the other predicate enabling flags to false and emit a warning.
    • When setting all predicate enabling flags to false, I automatically set UseParsePredicates to false as well and emit a warning.

Testing:

  • t1-4+hs-comp-stress, default
  • t1-4+hs-comp-stress, -XX:-UseParsePredicates, --enable-preview
  • t1-4+hs-comp-stress, -XX:-UseParsePredicates (found a reproducer for JDK-8388490)
  • t1-4+hs-comp-stress, -XX:-UseLoopLimitCheckPredicate

Thanks,
Christian



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-8388858: C2: Add UseLoopLimitCheckPredicate and UseParsePredicates flags (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32233

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Aug 6, 2026

Copy link
Copy Markdown

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

Comment on lines +55 to +56
"-XX:+UseLoopLimitCheckPredicate",
"-XX:+UseParsePredicates"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Needed to update this test, otherwise, it takes forever and times out.

@@ -1,95 +0,0 @@
/*

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Git wrongly did a remove + add here while it's just a rename.

Comment on lines +47 to +50
TestFramework.runWithFlags("-XX:-UseParsePredicates");
TestFramework.runWithFlags("-XX:-UseLoopLimitCheckPredicate");
TestFramework.runWithFlags("-XX:-UseAutoVectorizationPredicate");
TestFramework.runWithFlags("-XX:-ShortRunningLongLoop");

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added more variants here and strengthened the IR rules to check all parse predicates.

@openjdk

openjdk Bot commented Aug 6, 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 hotspot-dev@openjdk.org label Aug 6, 2026
@openjdk

openjdk Bot commented Aug 6, 2026

Copy link
Copy Markdown

@chhagedorn The following label will be automatically applied to this pull request:

  • hotspot

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 6, 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. This can be overridden with the /reviewers command.

@chhagedorn

Copy link
Copy Markdown
Member Author

/label add hotspot-compiler

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

openjdk Bot commented Aug 6, 2026

Copy link
Copy Markdown

@chhagedorn
The hotspot-compiler label was successfully added.

@chhagedorn
chhagedorn marked this pull request as ready for review August 6, 2026 09:35
@openjdk openjdk Bot added the rfr Pull request is ready for review label Aug 6, 2026
@mlbridge

mlbridge Bot commented Aug 6, 2026

Copy link
Copy Markdown

Webrevs

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

Labels

hotspot hotspot-dev@openjdk.org hotspot-compiler hotspot-compiler-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant