Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8266528: Optimize C2 VerifyIterativeGVN execution time #3872

Closed
wants to merge 1 commit into from

Conversation

huishi-hs
Copy link

@huishi-hs huishi-hs commented May 5, 2021

Optimization for VerifyIterativeGVN, motiviation is running with -XX:+VerifyIterativeGVN is extremly slow.

In simple test "-Xcomp -XX:+VerifyIterativeGVN -XX:-TieredCompilation -version", time reduced from 8.67s to 2.4s.
In extreme case hotspot/test/jtreg/compiler/escapeAnalysis/Test6689060.java, time reduced from 20000s to 92s.
Detail data in JBS description.

Optimizations includes:

  1. Optimize redundant verfications in PhaseIterGVN::verify_step. Nodes might verified multiple times.
    Redundant verifications between full pass and _verify_window single node process.
    Redundant verifications between different nodes in _verify_window

  2. Optimize def-use edge checking:
    Skip multiple checks for same x->n input edges.
    Skip redundant check in inner loop when counting how many x in n's input edges, skip current index.

  3. Optimize field access
    Replace "n->in(j)" with "n->_in[j]", skipping unuseful assert when invoking Node::in(int index).

Optimization#2/#3 decrease execution time and no other overhead.
optimization#1 adds 3 fields in class Node in debug build, they can be squeezed into an "int/long" if needed.

  jint _igvn_verify_depth_cur;
  jint _igvn_verify_depth_prev;
  julong _igvn_verify_epoch;

Progress

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

Issue

  • JDK-8266528: Optimize C2 VerifyIterativeGVN execution time

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3872

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented May 5, 2021

👋 Welcome back hshi! 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 May 5, 2021

@huishi-hs 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.

@huishi-hs
Copy link
Author

Not sure if adding fields in Node class debug builds in acceptable for verification purpose. Would appreciate for any comments.

@huishi-hs huishi-hs marked this pull request as ready for review May 6, 2021 01:39
@openjdk openjdk bot added the rfr Pull request is ready for review label May 6, 2021
@mlbridge
Copy link

mlbridge bot commented May 6, 2021

Webrevs

@huishi-hs
Copy link
Author

close this. optimize VerifyIterativeGVN with better solution

@huishi-hs huishi-hs closed this May 16, 2021
@huishi-hs huishi-hs deleted the VerifyIterativeGVN_opt branch May 16, 2021 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

1 participant