8266528: Optimize C2 VerifyIterativeGVN execution time #3872
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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
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.
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.
Progress
Issue
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