Dorit Naishlos wrote:
just a comment -
for better or for worse, scheduling complete-unrolling early would
take
away opportunities from autovectorization (at least as long as we're
looking for vectorization opportunities only across loop iterations
and not
in straight-line code). Indeed if a loop gets completely unrolled
then in
many cases it may be too short to gain much if anything from
vectorization, but ideally the vectorizer would decide what's worth
while
to vectorize and what not before such opportunities are eliminated (of
course we do not have such a cost model yet).
Yes, of course. But there is also a huge amount of manually unrolled
code around like autogenerated stuff, but I also do manual unrolling
sometimes. So the best thing would be if the autovectorizer recognizes
such straight-line "loop" code and other optimizations like SRA
recognize constant-small-times running loops.