RFR: 8305203: Simplify trimming operation in Region::Ideal [v3]

Vladimir Kozlov kvn at openjdk.org
Tue Apr 11 21:31:34 UTC 2023


On Tue, 11 Apr 2023 18:48:22 GMT, Xin Liu <xliu at openjdk.org> wrote:

>> This patch improves how Region::Ideal trims unreachable paths. 
>> 
>> 1. Don't restart from beginning. Trimming doesn't change the DU-chain.
>> 2. Replace DFIterator with DFIterator_Fast. The later is a raw pointer in release build.
>> 3. Don't call add_users_to_worklist(this) repeatly.
>> 4. ~~Reduce its strength from add_users_to_worklist to
>>    add_users_to_worklist0 because RegionNode has no special logic.~~(we can't measure any change of compilation time, so there's no point to simplify it)
>> 
>> This patch also includes a cosmetic change: rename n to 'use' inside of the loop.
>> Otherwise, we would overshadow Node* n = in(i). Nothing wrong but harder to read.
>
> Xin Liu has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Check outcnt() after loop.
>   
>   We avoid from calling add_users_to_worklist repeatly because we assume
>   we don't delete any use of RegionNode. Assert that after loop.
>   
>   This patch also changes back to add_users_to_worklist. We can't measure
>   any compilation time change. There's no point to use
>   add_users_to_worklist0.

Good.

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

Marked as reviewed by kvn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13238#pullrequestreview-1380112279


More information about the hotspot-compiler-dev mailing list