[PATCH] D75981: [LV] Allow large RT checks, if they are a fraction of the scalar cost (WIP)

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 15 08:48:59 PDT 2021


fhahn updated this revision to Diff 330679.
fhahn added a comment.
Herald added a subscriber: bmahjour.

In D75981#2605728 <https://reviews.llvm.org/D75981#2605728>, @ebrevnov wrote:

> I'd like to understand why you chose to go the way it is instead of taking cost of runtime checks into account in the cost model itself? To me, the cost model is the right place for that. I would expect to see something similar to what I did in https://reviews.llvm.org/D71053 for LoopVectorizationPlanner::mayDisregardRTChecksOverhead

That's a good point. I initially tried to keep things as closely modeled to the original code. I think the way the number of runtime checks is handled in LoopVectorizationRequirements is not ideal and makes things more difficult to follow. I am also not sure why those checks are handled separately  (in doesNotMeet). I tried to see if we can remove `doesNotMeet` and instead move the checks at an earlier and more appropriate place.

I put up D98634 <https://reviews.llvm.org/D98634> and D98633 <https://reviews.llvm.org/D98633> to remove `doesNotMeet`, which moved the decision whether to vectorize with RT checks to LVP::plan(). I also updated this patch to make the cost-based decision in LVP::plan. From there it should be easy to adjust it further to use it for more cost-based decisions, as in your patch. Is this more in line what you had in mind?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75981/new/

https://reviews.llvm.org/D75981

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/AArch64/runtime-check-size-based-threshold.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75981.330679.patch
Type: text/x-patch
Size: 11909 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210315/65ddaa2c/attachment.bin>


More information about the llvm-commits mailing list