[PATCH] D109296: [LV] Improve inclusivity of vectorization
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 5 13:14:11 PDT 2021
nikic added a comment.
Shouldn't this be taking the trip count into account somehow? Generating 7 times the scalar loop in run-time checks seems okay if you have thousands of iterations, but would be bad for a cold loop with a few iterations. After a quick look at D75981 <https://reviews.llvm.org/D75981> that variant does look at the TC. From the patch description, it's not entirely clear to me why a fixed factor of the scalar loop cost is preferable.
(Though as a comment on D75981 <https://reviews.llvm.org/D75981>, it uses getSmallBestKnownTC, which may return getSmallConstantMaxTripCount, which I believe will commonly just be INT_MAX for loops that are finite but have unknown trip count, so it may be drastically overestimating the TC for loops without exact trip count or profile data.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109296/new/
https://reviews.llvm.org/D109296
More information about the llvm-commits
mailing list