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

Emanuel Peter epeter at openjdk.org
Sun Jan 28 09:48:24 UTC 2024


On Sat, 27 Jan 2024 20:37:00 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Subtask of https://github.com/openjdk/jdk/pull/16620
>> 
>> Ignoring reductions in unrolling_analysis is unnecessary, and it adds unnecessary dependency of unrolling_analysis on reduction-analysis. That dependency needs to be removed for further refactoring.
>
> Change match the subject but your description is confusing:
> 
>> Ignoring reductions in unrolling_analysis is unnecessary, and it adds unnecessary dependency of unrolling_analysis on reduction-analysis. That dependency needs to be removed for further refactoring.
> 
> The only dependency you are talking about is the 'is_marked_reduction()` call in the condition you are removing. Right?
> 
> Do you know why this check was added?

@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 ;)

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

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


More information about the hotspot-compiler-dev mailing list