RFR: 8266528: Optimize C2 VerifyIterativeGVN execution time

Hui Shi hshi at openjdk.java.net
Thu May 6 01:44:13 UTC 2021


On Wed, 5 May 2021 07:30:46 GMT, Hui Shi <hshi at openjdk.org> wrote:

> 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;

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

-------------

PR: https://git.openjdk.java.net/jdk/pull/3872


More information about the hotspot-compiler-dev mailing list