RFR: JDK-8258603 c1 IR::verify is expensive [v5]
Ludvig Janiuk
duke at openjdk.java.net
Mon Jan 3 09:07:11 UTC 2022
On Fri, 17 Dec 2021 15:42:09 GMT, Ludvig Janiuk <duke at openjdk.java.net> wrote:
>> 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 "modified 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).
>
> Ludvig Janiuk has updated the pull request incrementally with one additional commit since the last revision:
>
> flip ifs
./build/optimized/images/jdk/bin/java -XX:+PrintCFG -version
CFG after parsing
B1 [0, 0] -> B2
B2 (S) [0, 0] -> B0 pred: B1
B0 (SV) [0, 0] pred: B2
CFG after optimizations
B1 [0, 0] -> B2
B2 (S) [0, 0] -> B0 pred: B1
B0 (SV) [0, 0] pred: B2
CFG after null check elimination
B1 [0, 0] -> B2
B2 (S) [0, 0] -> B0 dom B1 pred: B1
B0 (SV) [0, 0] dom B2 pred: B2
CFG before code generation
B1 [0, 0] -> B2
B2 (S) [0, 0] -> B0 dom B1 pred: B1
B0 (SV) [0, 0] dom B2 pred: B2
openjdk version "19-internal" 2022-09-20
OpenJDK Runtime Environment (build 19-internal+0-adhoc.opjaniuk.jdk)
OpenJDK 64-Bit Server VM (build 19-internal+0-adhoc.opjaniuk.jdk, mixed mode, sharing)
Is this as it should be?
-------------
PR: https://git.openjdk.java.net/jdk/pull/6850
More information about the hotspot-compiler-dev
mailing list