[PATCH] D109296: [LV] Improve inclusivity of vectorization

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 7 08:51:49 PDT 2021


lebedev.ri added a comment.

In D109296#2986995 <https://reviews.llvm.org/D109296#2986995>, @fhahn wrote:

> Unfortunately I do not have the bandwidth or energy to get D75981 <https://reviews.llvm.org/D75981> unstuck, as there are a few competing requests and my original plan was to fix the case where we have most information to make the best decision first (trip count available) and have people look into heuristics for their cases. However, most of the required infrastructure changes already landed and I updated D75981 <https://reviews.llvm.org/D75981> to just contain the remaining non-heuristic changes.

Sure, i can understand that. Thank ypu!

> Regardless of which heuristics we choose, I think we should not generate runtime checks if we can prove that RT + vector loop is more expensive than the scalar loop. I put up D109368 <https://reviews.llvm.org/D109368> to guard against that.

If we know the constant trip count, or there is a guard info that specifies the maximal trip count you mean? (but *NOT* PGO data)
Sounds reasonable to me i think.

>> instead of counting the number of groups, count the total number of members. We could do that, but is not guaranteed to correlate with the final cost of checks, see RuntimeCheckingPtrGroup::addPointer() I don't think this is the right fix
>
> I don't think that's a good idea, as it does not consider the cost of other runtime checks (like those generated for SCEV predicates required for the memory checks). If we want to make better cost based decisions, we should definitely include all aspects of the runtime checks we generate.

Yep, i remarked as much, this approach doesn't seem reasonable.

>> Just hardcode the budget. Might be a better approach than what we do now. I think then it should be ~160.
>
> As in a cost of 160 in terms of InstructionCost?

Yep.

>> My original proposal. Specify the budget in terms of the number of scalar loop iterations. I think then it should be ~12.
>
> Do you mean the cost of 12 scalar loop iterations?

Yep.


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