RFR: 8308994: C2: Re-implement experimental post loop vectorization [v2]
Emanuel Peter
epeter at openjdk.org
Mon Jul 3 14:55:17 UTC 2023
On Mon, 3 Jul 2023 08:31:20 GMT, Pengfei Li <pli at openjdk.org> wrote:
>> src/hotspot/share/opto/vmaskloop.cpp line 71:
>>
>>> 69: if (cl->loopexit()->in(0) != cl) return;
>>> 70: // Skip if some loop operations are pinned to the backedge
>>> 71: if (cl->back_control()->outcnt() != 1) return;
>>
>> It would be interesting to have some trace flag that tells us why we bailed out here and did not do the post-loop vectorization. Unless of course it becomes too noisy.
>
> Great suggestion! Done.
Thanks :)
>> src/hotspot/share/opto/vmaskloop.hpp line 95:
>>
>>> 93: }
>>> 94: return false;
>>> 95: }
>>
>> Do you not want to do this sort of implementation in `SWPointer` instead? There are already methods like `scaled_iv_plus_offset`, so it would fit in next to that, right?
>
> It doesn't fit well as functions in `SWPointer` can only be used for checking the pattern in indices. But this function may be used for checking the loop increment pattern which is not in array indices, perhaps `a[i] = b[i] * (i + 1)`. We don't have `SWPointer` constructed for this. I have rename the function to make the purpose clear.
Ah, you are right, that is a different use. Yes, better function name often does the trick 😊
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1250996321
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1250991219
More information about the hotspot-compiler-dev
mailing list