RFR: 8350756: C2 SuperWord Multiversioning: remove useless slow loop when the fast loop disappears [v2]

Emanuel Peter epeter at openjdk.org
Tue Mar 4 09:28:57 UTC 2025


On Tue, 4 Mar 2025 07:56:03 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   for Christian v1
>
> src/hotspot/share/opto/loopnode.cpp line 2743:
> 
>> 2741:   IfTrueNode* before_predicates = predicates.entry()->isa_IfTrue();
>> 2742:   if (before_predicates != nullptr &&
>> 2743:       before_predicates->in(0)->is_If() &&
> 
> Since this is after IGVN and we have not applied any loop transformations in this round, yet, shouldn't this always hold since we check that we have a `IfTrue` as child?

You are probably right. But the method `CountedLoopNode::find_multiversion_if_from_multiversion_fast_main_loop` could be used from other contexts later. So I'd rather not make such assumptions. What do you think?

> src/hotspot/share/opto/loopopts.cpp line 794:
> 
>> 792:     return nullptr;
>> 793:   }
>> 794:   if (bol->Opcode() != Op_Bool) {
> 
> Could we use `!bol->is_Bool()` here?

It would be equivalent now, since nobody inherits from `BoolNode`. But if someone ever inherits from it, then this condition would be weaker. Also: I just copied the condition.

I can do it if you still want me to do it, I'm on the fence with this one ;)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23865#discussion_r1978994303
PR Review Comment: https://git.openjdk.org/jdk/pull/23865#discussion_r1978989179


More information about the hotspot-compiler-dev mailing list