[llvm] [SLP] no need to generate extract for in-tree uses for original scala… (PR #76077)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 20 23:35:12 PST 2023


Enna1 wrote:

> That does not look correct, since it excludes these extracts from the cost estimation model.

Thanks for pointing out this!
I got it. I missed that the `ExternalUser` added in `buildExternalUses()` will do cost estimation, but the added `ExternalUser` added in `vectorizeTree()` will not.

I have updated the patch, replace extracts for original scalar instructions with corresponding vectorized instructions,
and remove
https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp#L11497-L11506
https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp#L11542-L11551
https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp#L11657-L11667
extracts.

PTAL, thanks!

https://github.com/llvm/llvm-project/pull/76077


More information about the llvm-commits mailing list