[PATCH] D32533: [SLPVectorizer] Limit the number of block chain instructions to max register size

Matthew Simpson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 09:28:26 PDT 2017


mssimpso added a comment.

In https://reviews.llvm.org/D32533#738239, @anna wrote:

> Not considering the physical vector register size is limiting the SLP cost model right? For example, in the target, we would have 4 shuffles instead of a single shuffle.


The physical vector register size is used when computing costs. In the loop vectorizer, we set a MaxVF based on the target register size, then compute the cost for all VFs up to this size and select the VF that is most profitable. But for SLP (for store-rooted trees), we have MinVecRegSize and MaxVecRegSize (where MaxVecRegSize is defined by the target). We try VFs based on these sizes from Max to Min and vectorize with the first one that is profitable (we don't try all of them).

But again, it looks to me like these limits are only imposed on the store-rooted trees. For vectorizeChainsInBlock and vectorizeGEPIndices, it looks like we basically let the vector be as wide as it can be, compute the cost of that, and if profitable, vectorize. The costs are still based on the target register size, though.


https://reviews.llvm.org/D32533





More information about the llvm-commits mailing list