[llvm-dev] [Proposal][RFC] Epilog loop vectorization

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 16 05:04:11 PDT 2017


On 03/16/2017 12:20 AM, Nema, Ashutosh wrote:
>
>
> I think this seems about right. We shouldn't re-compare the trip 
> counts in the epilogue loop if the alias check is false anyway:
>
> int start = 0;*
> *if (n >= vf) {
>   if (check) {
>     for (...; start += vf)
>       ...
>   } else { goto scalar; }
> } else { goto scalar; }
>
> if (n - start >= vf2) {
>   for (...; start += vf2)
>   ...
> }
>
> scalar:
> for (i = start; i < n; ++i) {
>> }
>
>
>  -Hal
>
>
> This layout looks OK **only when alias check is required**, but what 
> if alias check is not required in that case the layout probably will 
> looks like this:
>
> int start = 0;*
> *if (n >= vf) {
>   if (check) {
>     for (...; start += vf)
>       ...
>   } else { goto scalar; }
> } else { goto scalar; }
>
> if (n - start >= vf2) {
>   for (...; start += vf2)
>   ...
> }
>
> scalar:
> for (i = start; i < n; ++i) {
>> }
>
> For ‘n < vf’ it should try executing epilog vector loop but in this 
> layout it will execute scalar loop.

Agreed.

  -Hal

> Regards,
> Ashutosh

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170316/edd2e286/attachment-0001.html>


More information about the llvm-dev mailing list