RFR: 8333334: C2: Make result of `Node::dominates` more precise to enhance scalar replacement [v6]

Qizheng Xing qxing at openjdk.org
Tue Jul 9 02:48:37 UTC 2024


On Mon, 8 Jul 2024 12:01:51 GMT, Damon Fenacci <dfenacci at openjdk.org> wrote:

>> Qizheng Xing has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Make `Node::dominates` and `MemNode::all_controls_dominate` returns an `enum`.
>
> test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/ScalarReplacementWithGCBarrierTests.java line 107:
> 
>> 105:     @IR(phase = { CompilePhase.AFTER_PARSING }, counts = { IRNode.ALLOC, "1" })
>> 106:     @IR(phase = { CompilePhase.INCREMENTAL_BOXING_INLINE }, counts = { IRNode.ALLOC, "2" })
>> 107:     @IR(applyIf = { "UseG1GC", "true" }, phase = { CompilePhase.ITER_GVN_AFTER_ELIMINATION }, counts = { IRNode.ALLOC, "1" })
> 
> Your test checks for the number of allocations to return to one. However in your description and comments you talk about load nodes that aren't folded. What about adding another IR test to check the number of loads for completeness?

I think it's hard to add an intuitive and meaningful IR test for load nodes in this test case.

To construct a case that containing both eliminable GC pre-barriers and allocations, and have them interfere with each other, I had to put several object field reads/writes into nested loops. This makes a large number of load nodes appearing in this test case after some optimization phases. Perhaps after several more optimizations, most of them will disappear and new loads will appear again. So it's difficult to tell which load we really care about without looking at the Ideal graph dump via IGV.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19496#discussion_r1669576028


More information about the hotspot-compiler-dev mailing list