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

Emanuel Peter epeter at openjdk.org
Tue May 23 08:06:02 UTC 2023


On Thu, 11 May 2023 07:56:01 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Removed the noisy comment from the patch!
>> 
>> With VectorAPI users are expected to be more intelligent and your optimizations can be directly implemented in kernel which perform VectorADD operations in main loop followed by Reduction out of loop e.g.
>> 
>> 
>>   outer_loop : 
>>         hand_unrolled_vector_loop:
>>                v1 = VectorADD(broadcast(0))
>>                v2 = v1.VectorADD(LoadVector)
>>                v3 = v2.VectorADD(LoadVector)
>>                ...
>>                ...
>>       inner_loop_end
>>       res  += v3.ReductionAdd()
>>   outer_loop_end
>> 
>> 
>> So its not a pressing issue anyways for us.
>
>> @jatin-bhateja exactly. With the Vector API the vector reduction can be explicitly put outside the loop. With SuperWord, we need to take care of it in the compiler.
> 
> Your changes looks good to me. Thanks!

@jatin-bhateja @sviswa7 @fg1417 @vnkozlov @pfustc 
Thanks to everybody for the help and reviews!

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

PR Comment: https://git.openjdk.org/jdk/pull/13056#issuecomment-1558743466


More information about the hotspot-compiler-dev mailing list