[PATCH] D44574: [LV] Introduce TTI::getMinimumVF

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 16 12:08:38 PDT 2018


kparzysz added inline comments.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:6088
+  SmallVector<Type*,4> ElemTypes = getSmallestAndWidestTypes();
+  if (ElemTypes.empty())
+    return { 1, 1 };
----------------
This early exit introduced some changes in behavior. Originally, SmallestType and WidestType would be -1u and 8 respectively in case where no types were found.  The rest of the calculations would then operate on those values.

With this change, in a few testcases, the loops were not vectorized, so the vectorization width was set via metadata.  These testcases were not testing whether the vectorization actually occurs, but some other aspects of its functionality, so such changes did not seem unreasonable.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:7447
+  if (MinVF > 1)
+    buildVPlans(1, 1);
+  buildVPlans(MinVF, MaxVF);
----------------
This is somewhat suboptimal because the loop blocks are traversed twice, but I didn't want to make too many changes before the first review.


Repository:
  rL LLVM

https://reviews.llvm.org/D44574





More information about the llvm-commits mailing list