[PATCH] D149889: [TTI] Use users of GEP to guess access type in getGEPCost

Luke Lau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 09:11:31 PDT 2023


luke added a comment.

In D149889#4438606 <https://reviews.llvm.org/D149889#4438606>, @reames wrote:

> A macro comment on the approach here.  I think you're trying to do too much in a single change, and that makes it very hard to review.
>
> I would advise doing the following:
>
> - Remove the array of users API.  Instead, pass a single optional access type.
> - In TTIImpl, get the access type of the *sole user*.  If there isn't a sole user, *do not pass one*.
> - As a first step, use the access type in the legal addressing mode if available, and *otherwise the pointee type*.  This is slightly wrong, but is wrong in the "it's very close to what we used to do" kinda of way which will reduce test deltas significantly.  You can change this behavior in a follow up change if profitable.
> - Add tests *via cost model* which demonstrate the change above.  You should be able to (on RISCV) demonstrate the difference between access type of vector vs scalar.
> - All of the other changes in this review - i.e. everything in lib/Transform - should be independent changes structured after the above.

Agreed, thanks for the pointers. I've split it up and the diff is much smaller now. Will follow up with other patches to do the `lib/Transform` changes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149889



More information about the llvm-commits mailing list