[PATCH] D109296: [LV] Improve inclusivity of vectorization
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 5 13:16:55 PDT 2021
lebedev.ri added a comment.
Thank you for taking a look!
In D109296#2984302 <https://reviews.llvm.org/D109296#2984302>, @nikic wrote:
> 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.)
You answered your question in your last paragraph.
I'm fundamentally interested in variable trip count loops,
where we don't know the actual constant backedge-taken count,
so we simply can't take backedge-taken count into account here.
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