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

Sandhya Viswanathan sviswanathan at openjdk.org
Fri May 12 00:46:59 UTC 2023


On Thu, 11 May 2023 07:54:23 GMT, Emanuel Peter <epeter 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.

@eme64 Very nice and clean work. Thanks a lot for taking this up.

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

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


More information about the hotspot-compiler-dev mailing list