RFR: 8308994: C2: Re-implement experimental post loop vectorization [v2]

Pengfei Li pli at openjdk.org
Mon Jul 3 08:17:11 UTC 2023


On Fri, 23 Jun 2023 11:02:39 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> If you are going to do that, I'd suggest doing this refactoring in a separate RFE. It would help in general with any future extension to auto-vectorization.
>
> Can we untangle it completely from SuperWord? it seems you have made it optional, so yes. And maybe we can also make the trace flags like `_slp->is_trace_alignment()` independent? It would be nice to also be able to trace this for non SuperWord-contexts like post-loop masked vectoriaztion, right?

I will try to do this in another JBS and come back here later.

>> After all, should the `VectorizeDebug` flag not apply everywhere? See `phase->C->directive()->VectorizeDebugOption`.
>
> I'd also move this to some static functions in a potential "autovectorization.hpp", and move `_vector_loop_debug` there, together with all its `is_trace...` accessors.

I agree current code here is a bit ugly. I will try to make it better in `SWPointer` refactoring.

>> Oh dear, I just saw the same pattern in:
>> 
>> bool TypeNode::cmp(const Node& n) const {
>>   return !Type::cmp(_type, ((TypeNode&)n)._type);
>> }
>> 
>> We should try to avoid doing that.
>
> Even if all callers currently ensure that `n` has the correct type, I'd say it is still not a great idea to cast without checking, at least in debug.

I searched all C2 code and saw a lot of such patterns. Perhaps doing this in another RFE?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1250448780
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1250450253
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1250456476


More information about the hotspot-compiler-dev mailing list