[PATCH] D33457: [LV] Update type in cost model for scalarization

Matthew Simpson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 07:34:01 PDT 2017


mssimpso added a comment.

Thanks, Ayal! The change is mostly noise on the hardware (AArch64 Kryo/Falkor) and benchmarks (spec, test-suite) I tested.

For some context, I had been experimenting with a patch that changes the cost model's "tie-break" rule when I noticed the issue. Right now we select the smallest VF with the best score (so scalar wins out if there's no benefit from vectorization). But I was testing a patch that changed this. If any VF > 1 was better than VF == 1, it selected the largest VF having the best score. So we would prefer wider vectors in a tie if any vectorization was better than scalar.

For some loops, this interacted badly with the MaxVF determination based on types. Currently, if we know a load or store will be scalarized, we don't consider it when collecting type sizes, which determine the MaxVF. So with the above experimental patch, I was seeing loops where nothing was vectorized being effectively unrolled by the MaxVF, because VectorTy wasn't being set properly.

Sorry for the long explanation!


https://reviews.llvm.org/D33457





More information about the llvm-commits mailing list