[PATCH] D76956: [TTI][SLP] Add TTI interface to estimate cost of chain of vector inserts/extracts.

Valeriy Dmitriev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 10:24:14 PDT 2020


vdmitrie added a comment.

In D76956#1983984 <https://reviews.llvm.org/D76956#1983984>, @RKSimon wrote:

> @vdmitrie I've created D78216 <https://reviews.llvm.org/D78216> to demonstrate the approach I had in mind.


As I see D78216 <https://reviews.llvm.org/D78216> does not target the problem I was trying to resolve here. I specifically targeted extracts/inserts to/from vectors that are 256bits or 512 bits.

If we for example need to estimate cost to insert elements 6 and 7 into <8 x float> vector current approach is: getVectorInstrCost for index 6 plus getVectorInstrCost for index 7. D78216 <https://reviews.llvm.org/D78216> does not change that.
That isn't quite accurate. And here is why.
It estimates as if generated code was like this:

1. extract upper 128bits subvector from 256 bits vector
2. insert element 6 into the 128bits subvector
3. insert upper 128bits subvector back to 256 vector
4. extract upper 128bits subvector from 256 bits vector
5. insert element 7 into the 128bits subvector
6. insert upper 128bits subvector back to 256 vector

But actual code will be:

1. extract upper 128bits subvector from 256 bits vector
2. insert element 6 into the 128bits subvector
3. insert element 7 into the 128bits subvector
4. insert upper 128bits subvector back to 256 vector




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76956





More information about the llvm-commits mailing list