RFR: JDK-8277496 Remove duplication in c1 Block successor lists
Ludvig Janiuk
duke at openjdk.java.net
Tue Nov 30 14:20:34 UTC 2021
Remove `BlockBegin::_successors`, leaving `BlockEnd::_sux` as the SSOT for the successors of a block. Prior to this PR, these two lists were both tracking the same list of successors of the same block. This necessitated a lot of syncing and verification code.
With this PR, as long as a block has its end pointer assigned, its successors can always be reached by querying the `BlockEnd`. `BlockEnd::_sux` becomes the single place where the list of successors is maintained. When modified, the successor list no longer needs to be synchronized in two places, reducing complexity and confusion. Asserts on the two lists corresponding no longer need to be made.
While being created in `GraphBuilder`, `BlockBegin`s don't have a `BlockEnd` assigned yet. To temporarily track block successors in this small interval, add a lookup structure `BlockListBuilder::_bci2block_successors`.
This PR affects debug printing code. If the end pointer of a `BlockBegin `is NULL for some reason, then the successor list can no longer be printed (for obious reasons).
This PR introduces an additional check to IR::verify to check that `BlockBegin::_end` is not set to null.
This PR also performs some minor refactoring, polishing, inlining, and removing of dead code around the affected areas.
The commit history has been polished to attempt to guide the reader through the changes.
hs-tier1 and hs-tier2 tests pass.
-------------
Commit messages:
- extract disconnect_from_graph
- rm duplicated printing
- add is_successor
- comment on end == null in BlockListBuilder()
- CFGPrinter don't print sux when end is NULL
- Remove extraneous assertions in build_hir
- IR verify that ends aren't null
- simplify blockmerger
- remove dead code
- improve set_end
- ... and 18 more: https://git.openjdk.java.net/jdk/compare/a5f2a58b...284cc91a
Changes: https://git.openjdk.java.net/jdk/pull/6614/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6614&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8277496
Stats: 198 lines in 8 files changed: 94 ins; 73 del; 31 mod
Patch: https://git.openjdk.java.net/jdk/pull/6614.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/6614/head:pull/6614
PR: https://git.openjdk.java.net/jdk/pull/6614
More information about the hotspot-compiler-dev
mailing list