Skip to content
This repository has been archived by the owner. It is now read-only.

8278790: Inner loop of long loop nest runs for too few iterations #35

Closed
wants to merge 1 commit into from

Conversation

rwestrel
Copy link
Contributor

@rwestrel rwestrel commented Dec 16, 2021

Given a counted loop that iterates in [A, Z), when long range checks
are transformed into int range checks, a loop nest is created and
the inner loop iterates in [0, Z2).

The limits of the inner loop are adjusted to guarantee no overflow for
the range of values of the inner loop. That is for a range check:

i * scale + offset <u length

  1. the bounds of the inner loop are adjusted to roughly [0,
    max_jint/scale).

Also, we don't want to loose what we know about the bounds of the loop
being transformed.

  1. So the bound of the inner loop are also adjusted to [0, min(Z2, Z - A))

The bug here is that 2) is performed before 1). This was spotted with
a micro benchmarks where the initial loop had only ~2000
iterations. The transformed loop is expected to run for the same 2000
iterations but instead ran for 2000/scale iterations.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8278790: Inner loop of long loop nest runs for too few iterations

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk18 pull/35/head:pull/35
$ git checkout pull/35

Update a local copy of the PR:
$ git checkout pull/35
$ git pull https://git.openjdk.java.net/jdk18 pull/35/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 35

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk18/pull/35.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Dec 16, 2021

👋 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 openjdk bot added the rfr label Dec 16, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 16, 2021

@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 label Dec 16, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Dec 16, 2021

Webrevs

Copy link
Member

@chhagedorn chhagedorn left a comment

Looks good!

@openjdk
Copy link

@openjdk openjdk bot commented Dec 16, 2021

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

8278790: Inner loop of long loop nest runs for too few iterations

Reviewed-by: chagedorn, neliasso

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

  • e82310f: 8278575: update jcmd GC.finalizer_info to list finalization status
  • d3408a4: 8277964: ClassCastException with no stack trace is thrown with -Xcomp in method handle invocation
  • 69b5d49: 8272064: test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java needs update for JEP 416
  • d6b5544: 8278607: Misc issues in foreign API javadoc
  • 918e339: 8278233: [macos] tools/jpackage tests timeout due to /usr/bin/osascript
  • f48a3e8: 8278758: runtime/BootstrapMethod/BSMCalledTwice.java fails with release VMs after JDK-8262134
  • 0cc989b: 8278744: KeyStore:getAttributes() not returning unmodifiable Set

Please see this link for an up-to-date comparison between the source branch of this pull request and 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 added the ready label Dec 16, 2021
Copy link

@neliasso neliasso left a comment

Looks good!

@rwestrel
Copy link
Contributor Author

@rwestrel rwestrel commented Dec 17, 2021

@chhagedorn @neliasso thanks for the reviews.

@rwestrel
Copy link
Contributor Author

@rwestrel rwestrel commented Dec 17, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Dec 17, 2021

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

  • 8494fec: 8278796: Incorrect behavior of FloatVector.withLane on X86
  • f5d7c77: 8276826: Clarify the ModuleDescriptor.Version specification’s treatment of repeated punctuation characters
  • be6b90d: 8278574: update --help-extra message to include default value of --finalization option
  • aec1b03: 8278389: SuspendibleThreadSet::_suspend_all should be volatile/atomic
  • e82310f: 8278575: update jcmd GC.finalizer_info to list finalization status
  • d3408a4: 8277964: ClassCastException with no stack trace is thrown with -Xcomp in method handle invocation
  • 69b5d49: 8272064: test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java needs update for JEP 416
  • d6b5544: 8278607: Misc issues in foreign API javadoc
  • 918e339: 8278233: [macos] tools/jpackage tests timeout due to /usr/bin/osascript
  • f48a3e8: 8278758: runtime/BootstrapMethod/BSMCalledTwice.java fails with release VMs after JDK-8262134
  • ... and 1 more: https://git.openjdk.java.net/jdk18/compare/475ec8e6c5abc3431344d69bd46395e8c4b46e4c...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated label Dec 17, 2021
@openjdk openjdk bot closed this Dec 17, 2021
@openjdk openjdk bot removed ready rfr labels Dec 17, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 17, 2021

@rwestrel Pushed as commit bb7efb3.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotspot-compiler integrated
3 participants