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

Matthew Simpson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 14:36:38 PDT 2017


mssimpso added inline comments.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:7159
+                           TTI.getNumberOfParts(VectorTy) < VF &&
+                           VectorTy->isVectorTy();
   return VectorizationCostTy(C, TypeNotScalarized);
----------------
Ayal wrote:
> isVectorTy() implies !isVoidTy(), so checking the latter becomes redundant. Does the VF > 1 check also become redundant?
Right, I thought there may be some redundancy here. So we should replace "!VectorTy->isVoidTy()" with "VectorTy->isVectorTy()". Checking that the type is actually a vector is what we really want.

I'm not quite sure about "VF > 1". We only care about scalarization if we are vectorizing. I think it might be needed for the "TTI.getNumberOfParts(VectorTy) < VF" check, which wouldn't make sense if VF == 1.


https://reviews.llvm.org/D33457





More information about the llvm-commits mailing list