RFR: 8324794: C2 SuperWord: do not ignore reductions in SuperWord::unrolling_analysis

Emanuel Peter epeter at openjdk.org
Tue Jan 30 12:16:25 UTC 2024


On Mon, 29 Jan 2024 17:41:28 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> @vnkozlov Yes, exactly, the call to `is_marked_reduction`. Other than that, unrolling_analysis could be static, and does not need any information from SuperWord. I'd like to splitt off unrolling_analysis, and so I'll have to remove the call to `is_marked_reduction`.
>> 
>> It seems like this was in from the begginning, when Michael Berg added the unrolling_analysis with https://github.com/openjdk/jdk/commit/7c7b91845f94d13b8fed7911be7f933cf0df28d4
>> 
>> I can see no reason stated in the RFE or the code itself.
>> 
>> I can only speculate: maybe the idea was that reductions are not profitable, unless there are other nodes, like stores and loads. So if we only find reductions, then we would not adjust the unrolling, since we are not expecting vectorization anyway. Again: only speculation. You reviewed the code in 2015, maybe you still remember the reason ;)
>> 
>> FYI: only reductions may in the not too distant future become vectorizable in a profitable way, so I think removing this is good anyway.
>
>> I can only speculate: maybe the idea was that reductions are not profitable, unless there are other nodes, like stores and loads. So if we only find reductions, then we would not adjust the unrolling, since we are not expecting vectorization anyway. Again: only speculation. You reviewed the code in 2015, maybe you still remember the reason ;)
> 
> I looked and there was no discussion about that during review. Originally it was not SuperWord analysis - it only looked for arithmetic Phi nodes in loop. Last year we changed it: [1be80a44](https://github.com/openjdk/jdk/commit/1be80a4445cf74adc9b2cd5bf262a897f9ede74f)
> I think the check simplify `unrolling_analysis` code since we skip nodes we already know about them.

@vnkozlov this change here is in preparation for this next RFE: https://github.com/openjdk/jdk/pull/17624

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

PR Comment: https://git.openjdk.org/jdk/pull/17604#issuecomment-1916711979


More information about the hotspot-compiler-dev mailing list