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

Qizheng Xing qxing at openjdk.org
Tue Jun 25 07:32:29 UTC 2024


On Mon, 17 Jun 2024 05:59:58 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>>> Great! Please have a look at the failure that I reported above.
>> 
>> I noticed that the IR test log shows there is only one Allocate node in IR, while I can not reproduce this with my JDK clone, even after rebasing to the latest commit and using the same VM options.
>> 
>> The IR test that I added asserts there are two allocations after boxing inlining, one for `Iter`, one for the `Integer` inside it. But in the IR dump, there's only one `Iter` allocation left, and all the LoadN/LoadI nodes of `Integer` come out from that allocation. I don't know which optimization performs this.
>> 
>> Am I missing something? Sorry for not familiar with the IR testing framework, maybe providing an option to match allocations at exact locations would help to build this test.
>> 
>> I'm still trying to get the test to work. BTW, could you observe the performance improvement in `ConcurrentHashMap` iteration after applying this patch to your JDK?
>
>> Am I missing something? Sorry for not familiar with the IR testing framework, maybe providing an option to match allocations at exact locations would help to build this test.
> 
> I don't have time to look into this in detail right now but usually such issue come from a method not being inlined (in that case you need to enforce inlining via [@ForceInline](https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/compiler/lib/ir_framework/ForceInline.java) or via compile commands) or because an uncommon trap is added. You should be able to see that in the IR dump.
> 
>> BTW, could you observe the performance improvement in ConcurrentHashMap iteration after applying this patch to your JDK?
> 
> No, I didn't get a chance to try this out yet.

@TobiHartmann Hi!

Thanks for your previous suggestions. After several attempts, I can reproduce the failure after adding `@DontInline` for `List::iter`.

I have added `@ForceInline` for all relevant methods to ensure they are all inlined properly, and this patch is now ready for review.

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

PR Comment: https://git.openjdk.org/jdk/pull/19496#issuecomment-2188180850


More information about the hotspot-compiler-dev mailing list