RFR: 8331168: Introduce PredicateEntryIterator to iterate through predicate entries [v2]

Christian Hagedorn chagedorn at openjdk.org
Mon Jun 17 11:01:00 UTC 2024


On Fri, 14 Jun 2024 14:53:30 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> Christian Hagedorn has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Introduce is_strict_dominator()
>>  - Merge branch 'master' into JDK-8331168
>>  - 8331168: Introduce PredicateEntryIterator to iterate through predicate entries
>
> src/hotspot/share/opto/loopnode.cpp line 6385:
> 
>> 6383:     while (predicate_iterator.has_next()) {
>> 6384:       Node* next_predicate_entry = predicate_iterator.next_entry();
>> 6385:       if (is_dominator(next_predicate_entry, early) && next_predicate_entry != early) {
> 
> Maybe be want a `is_strict_dominator` method?

Good idea. I've added such a method. I quickly went through existing uses of `is_dominator()` and found another place where we could use the new method. Applied it there as well.

> src/hotspot/share/opto/predicates.cpp line 35:
> 
>> 33: Node* AssertionPredicatesWithHalt::find_entry(Node* start_proj) {
>> 34:   Node* entry = start_proj;
>> 35:   while (AssertionPredicateWithHalt::is_predicate(entry)) {
> 
> Is it `AssertionPredicateWithHalt::is_predicate` instead of simply `is_predicate` on purpose?

It's hard to spot but we are inside AssertionPredicate***s***WithHalt (with s) and call a method from AssertionPredicatesWithHalt (without s).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19716#discussion_r1642321497
PR Review Comment: https://git.openjdk.org/jdk/pull/19716#discussion_r1642305111


More information about the hotspot-compiler-dev mailing list