RFR: 8266528: Optimize C2 VerifyIterativeGVN execution time [v3]

Hui Shi hshi at openjdk.java.net
Wed May 19 01:42:07 UTC 2021


> Please help review this enhancement for VerifyIterativeGVN, reduce about 3x - 200x executime time when VerifyIterativeGVN is on.
> 
> 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 95s.
> 
> Test with "-Xbatch -XX:+VerifyIterativeGVN -XX:-TieredCompilation", tier1/2/3 with fastdebug and no regression.
> 
> 1. Remove node_arena()->contains checking for verifing  nodes.  _verify_window  is reset before every PhaseIterGVN::optimize. Searching from root or nodes in _verify_window  will not meet nodes whose _idx is not  unique (PhaseIterGVN::optimize is not triggered in the middle of PhaseRenumberLive ).  Assertion every node is in current node_arena() in Node::verify, passes tier1/2/3 checks (with -Xbatch -XX:+VerifyIterativeGVN -XX:-TieredCompilation), no assertion failure happens.
> 
> 2. Combine verification for nodes in _verify_window into one worklist and skipping redundant nodes in _verify_window.
> 
> 3. Optimize duplicate checking for same input nodes, skipping if current input index is not its first occurence.
> 
> 4. Optimize field access: Replace "n->in(j)" with "n->_in[j]", same with outcnt calucation for input node x.

Hui Shi has updated the pull request incrementally with one additional commit since the last revision:

  Add comments for duplicated input processing in Node::Verify

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4045/files
  - new: https://git.openjdk.java.net/jdk/pull/4045/files/9635c9b9..1ca049ff

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4045&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4045&range=01-02

  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4045.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4045/head:pull/4045

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


More information about the hotspot-compiler-dev mailing list