RFR: 8266528: Optimize C2 VerifyIterativeGVN execution time
Hui Shi
hshi at openjdk.java.net
Thu May 6 01:44:13 UTC 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;
-------------
Commit messages:
- 8266528: Optimize C2 VerifyIterativeGVN execution time
Changes: https://git.openjdk.java.net/jdk/pull/3872/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3872&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8266528
Stats: 117 lines in 4 files changed: 83 ins; 5 del; 29 mod
Patch: https://git.openjdk.java.net/jdk/pull/3872.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/3872/head:pull/3872
PR: https://git.openjdk.java.net/jdk/pull/3872
More information about the hotspot-compiler-dev
mailing list