[PATCH] vect: Fix epilogue loop handling of partial vectors

Richard Sandiford richard.sandiford@arm.com
Wed Sep 23 11:33:40 GMT 2020


"Kewen.Lin" <linkw@linux.ibm.com> writes:
> on 2020/9/22 下午10:34, Richard Sandiford wrote:
>> Also, while splitting out the logic that handles epilogues with
>> constant iterations, I added a check to make sure that we don't
>> try to use partial vectors to vectorise a single-scalar loop.
>> This required some changes to the Power tests.
>
> Thanks for the great rework!  Using partial vector should be more
> costly than just being with one single scalar iteration, I think
> this is an improvement.  But I'm not sure whether someone would
> argue that in the context of no-vect-cost-model, it's expected to
> go with vectorized code, cost-modeling check can punt this when
> it takes effects.  Personally I'm fine on this anyway.

Yeah, if we costed the epilogue loop against its final iteration
count, we'd hopefully reject it then.  But the same problem applies
to costing as to other things: we do the costing based on the number
of iterations of the main loop, rather than on the number of iterations
of the epilogue.

FWIW, we don't try to vectorize single-iteration main loops either
(although of course they shouldn't exist in the first place :-)).

Thanks,
Richard


More information about the Gcc-patches mailing list