RFR: JDK-8258603 c1 IR::verify is expensive

Ludvig Janiuk duke at openjdk.java.net
Wed Dec 15 15:47:13 UTC 2021


IR::verify iterates the whole object graph. This proves costly when used in e.g. BlockMerger inside of iterations over BlockLists, leading to quadratic or worse complexities as a function of bytecode length. In several cases, only a few Blocks were changed, and there was no need to go over the whole graph, but until now there was no less blunt tool for verification than IR::verify.

This PR introduces IR::verify_local, intended to be used when only a defined set of blocks have been modified. As a complement, expand_with_neighbors provides a way to also capture the neighbors of the "modifies set" ahead of modification, so that afterwards the appropriate asserts can be made on all blocks which might possibly have been changed. All this should let us remove the expensive IR::verify calls, while still performing equivalent (or stricter) assertions.

Some changes have been made in the verifiers along the way. Some amount of refactoring, and even added invariants (see validate_edge_mutiality).

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

Commit messages:
 - Use delayed asserts
 - add expand_with_neighborhood
 - first use verify_local
 - add verify_local
 - Assert edge mutuality in IR::verify
 - rename PredecessorValidator
 - XentryFlag closure split from PredecessorValidator
 - Comment: validation goals
 - add validate edge mutuality
 - add blockEnd::is_sux
 - ... and 6 more: https://git.openjdk.java.net/jdk/compare/3f9638d1...716803bf

Changes: https://git.openjdk.java.net/jdk/pull/6850/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6850&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8258603
  Stats: 163 lines in 4 files changed: 134 ins; 14 del; 15 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6850.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6850/head:pull/6850

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


More information about the hotspot-compiler-dev mailing list