Skip to content

Conversation

@rwestrel
Copy link
Contributor

@rwestrel rwestrel commented Dec 2, 2024

8339733 fixed controls for updated pre/main limits during
do_range_check(). However, it missed one issue:

Control for the new limits is computed in new_limit_ctrl for both
pre and main loops. new_limit_ctrl is currently initialized from the
pre limit control but it also needs to take the main loop limit
control into account as sometimes, the main loop limit control is
below the pre limit and pre loop entry control.

8339733 also introduced a couple bugs. Control of the Bool/Cmp
nodes are updated for the pre and main loop to new_limit_ctrl. But
that's incorrect because new_limit_ctrl may be above the pre loop
while the Bool/Cmp for the pre loop are in the loop (because they
depend on the loop iv) and for the main loop are after the pre loop
(because they depend on the iv out of the pre loop). I fixed this for
the pre loop by setting control for the Bool/Cmp to be as late as
possible. For the main loop, no change appears to be required as
control computed by c2 is already late enough. I've added an assert
instead.


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-8345299: C2: some nodes can still have incorrect control after do_range_check() (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22485

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@rwestrel rwestrel marked this pull request as draft December 2, 2024 13:53
@bridgekeeper
Copy link

bridgekeeper bot commented Dec 2, 2024

👋 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 Dec 2, 2024

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

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

8345299: C2: some nodes can still have incorrect control after do_range_check()

Reviewed-by: chagedorn, kvn

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

  • 5cc150c: 8342979: Start of release updates for JDK 25
  • 85fedbf: 8344607: Link Time Optimization - basic support for clang
  • 5a0899f: 8345302: Building microbenchmarks require larger Java heap
  • 1ece4f9: 8345514: Should use internal class name when calling ClassLoader.getResourceAsByteArray
  • ef8da28: 8345591: [aarch64] macroAssembler_aarch64.cpp compile fails ceil_log2 not declared
  • 7513b13: 8328944: NMT reports "unknown" memory
  • 691e692: 8345565: Remove remaining SecurityManager motivated APIs from sun.reflect.util
  • 97b8a09: 8345339: JFR: Missing javadoc for RecordingStream::onMetadata
  • 456c71d: 8343699: [aarch64] Bug in MacroAssembler::klass_decode_mode()
  • 308357c: 8345578: New test in JDK-8343622 fails with a promoted build
  • ... and 148 more: https://git.openjdk.org/jdk/compare/3b21a298c29d88720f6bfb2dc1f3305b6a3db307...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
Copy link

openjdk bot commented Dec 2, 2024

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

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Dec 2, 2024
@rwestrel rwestrel marked this pull request as ready for review December 2, 2024 13:56
@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 2, 2024
@mlbridge
Copy link

mlbridge bot commented Dec 2, 2024

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.

Looks good to me. Do you have a regression test where this leads to an actual failure?

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 3, 2024
@rwestrel
Copy link
Contributor Author

rwestrel commented Dec 3, 2024

Looks good to me. Do you have a regression test where this leads to an actual failure?

I don't. This seems unlikely to cause issues with the current code. I ran into this while working on JDK-8275202 where new code I've added is failing.

@chhagedorn
Copy link
Member

I see, thanks for background!

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Few comments.

Comment on lines 2779 to 2781
// new pre_limit can push Bool/Cmp/Opaque nodes down (when one of the eliminated condition has parameters that are not
// loop invariant in the pre loop.
set_ctrl(pre_opaq, new_limit_ctrl);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update this comment to explain different control settings as you did in PR's description.

Comment on lines 2823 to 2825
// new main_limit can push Bool/Cmp nodes down (when one of the eliminated condition has parameters that are not loop
// invariant in the pre loop.
// invariant in the pre loop).
set_ctrl(opqzm, new_limit_ctrl);
Copy link
Contributor

Choose a reason for hiding this comment

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

Update this comment too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both done in new commit. Do the comments look ok to you?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Dec 4, 2024
Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Good.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 4, 2024
@rwestrel
Copy link
Contributor Author

rwestrel commented Dec 6, 2024

@vnkozlov @chhagedorn thanks for the reviews

@rwestrel
Copy link
Contributor Author

rwestrel commented Dec 6, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Dec 6, 2024

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

  • 2286fae: 8345159: RISCV: Fix -Wzero-as-null-pointer-constant warning in emit_static_call_stub
  • 8403285: 8268145: [macos] Rendering artifacts is seen when text inside the JTable with TableCellEditor having JTextfield
  • aa38284: 8345435: Eliminate tier1_compiler_not_xcomp group
  • 9284602: 8345628: [BACKOUT] JDK-8287122 Use gcc12 -ftrivial-auto-var-init=pattern in debug builds
  • 41c8971: 8287122: Use gcc12 -ftrivial-auto-var-init=pattern in debug builds
  • 5da0eee: 8285692: Enable _FORTIFY_SOURCE=2 when building with Clang
  • daa2ba5: 8339622: Regression in make open-hotspot-xcode-project
  • 6f6bce5: 8344559: Log is spammed by missing pandoc warnings when building man pages
  • 5f30a8d: 8345424: Move FindDebuginfoFiles out of FileUtils.gmk
  • bf0debc: 8343890: SEGV crash in RunTimeClassInfo::klass
  • ... and 161 more: https://git.openjdk.org/jdk/compare/3b21a298c29d88720f6bfb2dc1f3305b6a3db307...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Dec 6, 2024

@rwestrel Pushed as commit d9a2213.

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

3 participants