SLP/Loop vectorizer pass ordering

Zinovy Nis zinovy.nis at gmail.com
Tue Oct 7 10:34:13 PDT 2014


Hi.

I attached a reduced sample, based on https://code.google.com/p/aobench/.

Run it first with an old SLP order:

1) clang -c -Ofast -static -march=core-avx2 aobench.cpp -Rpass=.
-mllvm -debug-only=loop-vectorize -mllvm
-run-slp-after-loop-vectorization=0

and then with a new order:

2) clang -c -Ofast -static -march=core-avx2 aobench.cpp -Rpass=.
-debug-only=loop-vectorize -mllvm -run-slp-after-loop-vectorization=1

and see the logs:

1) aobench.cpp:59:9: remark: vectorized loop (vectorization factor: 8,
unrolling interleave factor: 1) [-Rpass=loop-vectorize]
2) aobench.cpp:59:9: remark: loop ***not*** vectorized: use
-Rpass-analysis=loop-vectorize for more info
[-Rpass-missed=loop-vectorize]

LV: Found an unidentified PHI.  %occlusion.017 = phi float [
1.000000e+00, %entry ], [ %phitmp, %for.inc.for.body_crit_edge ]
LV: Can't vectorize the instructions or CFG
LV: Not vectorizing: Cannot prove legality.

2014-10-06 17:46 GMT+04:00 Hal Finkel <hfinkel at anl.gov>:
> ----- Original Message -----
>> From: "Zinovy Nis" <zinovy.nis at gmail.com>
>> To: "Hal Finkel" <hfinkel at anl.gov>
>> Cc: "LLVM Commits" <llvm-commits at cs.uiuc.edu>, "Tobias Grosser" <tobias at grosser.es>, "Chandler Carruth"
>> <chandlerc at google.com>, "Nadav Rotem" <nrotem at apple.com>, "Arnold Schwaighofer" <aschwaighofer at apple.com>
>> Sent: Monday, October 6, 2014 8:44:28 AM
>> Subject: Re: SLP/Loop vectorizer pass ordering
>>
>> A bit later. At least GVN creates critical edges which are not
>> handled
>> by loop vectorizer then.
>
> Okay, please do (this is fairly important) -- if you can extract some relevant IR, filing a bug report would be great. Are you saying that running SLP early inhibits GVN from creating critical edges that the loop vectorizer does not understand?
>
> Thanks again,
> Hal
>
>>
>> 2014-10-06 17:33 GMT+04:00 Hal Finkel <hfinkel at anl.gov>:
>> > ----- Original Message -----
>> >> From: "Zinovy Nis" <zinovy.nis at gmail.com>
>> >> To: "Chandler Carruth" <chandlerc at google.com>
>> >> Cc: "LLVM Commits" <llvm-commits at cs.uiuc.edu>, "Tobias Grosser"
>> >> <tobias at grosser.es>
>> >> Sent: Monday, October 6, 2014 8:19:24 AM
>> >> Subject: Re: SLP/Loop vectorizer pass ordering
>> >>
>> >> Please wait a while, I'm using it to revert the new order as it
>> >> introduces regression in our internal benchmark: SLP was creating
>> >> loop
>> >> vectorization opportunities when was called before LV. Now no such
>> >> opportunities are available, so we've got a regression.
>> >
>> > Interesting. Can you provide any further details?
>> >
>> >  -Hal
>> >
>> >>
>> >> 2014-10-06 3:28 GMT+04:00 Chandler Carruth <chandlerc at google.com>:
>> >> >
>> >> > On Thu, Sep 4, 2014 at 6:32 AM, James Molloy
>> >> > <james at jamesmolloy.co.uk>
>> >> > wrote:
>> >> >>
>> >> >> Hi Hal, Chandler,
>> >> >>
>> >> >> r217144.
>> >> >
>> >> >
>> >> > Is anyone still using the option to disable this? If I don't
>> >> > hear
>> >> > anything,
>> >> > I'll remove this option entirely in the next week.
>> >> >
>> >> > _______________________________________________
>> >> > llvm-commits mailing list
>> >> > llvm-commits at cs.uiuc.edu
>> >> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> >> >
>> >> _______________________________________________
>> >> llvm-commits mailing list
>> >> llvm-commits at cs.uiuc.edu
>> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> >>
>> >
>> > --
>> > Hal Finkel
>> > Assistant Computational Scientist
>> > Leadership Computing Facility
>> > Argonne National Laboratory
>>
>
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aobench.cpp
Type: text/x-c++src
Size: 1318 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141007/cedd3476/attachment.cpp>


More information about the llvm-commits mailing list