RFR: 8302652: [SuperWord] Reduction should happen after loop, when possible [v5]

Emanuel Peter epeter at openjdk.org
Fri May 12 07:05:54 UTC 2023


On Fri, 12 May 2023 06:49:29 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   use is_counted and is_innermost
>
> src/hotspot/share/opto/loopopts.cpp line 4284:
> 
>> 4282:     // Create post-loop reduction.
>> 4283:     Node* last_accumulator = phi->in(2);
>> 4284:     Node* post_loop_reduction = ReductionNode::make_from_vopc(first_ur->Opcode(), nullptr, init, last_accumulator, bt);
> 
> Should this be guarded by a safe _Matcher::match_rule_supported_vector_ .

Do you think that is necessary? After all I am just creating the same type of `ReductionNode` that I already replaced in the loop, right? If anything, we should guard this:
https://github.com/openjdk/jdk/blob/31d977c21f7a2b62fb8123bc7967731aa961e373/src/hotspot/share/opto/loopopts.cpp#L4272

But what platform would support the reduction if it does not support the normal vector-op?

What do you think?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13056#discussion_r1191986280


More information about the hotspot-compiler-dev mailing list