[llvm] [LV] Increase max VF if vectorized function variants exist (PR #66639)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 08:28:48 PDT 2023


================
@@ -5152,7 +5152,8 @@ ElementCount LoopVectorizationCostModel::getMaximizedVFForTarget(
                            : TargetTransformInfo::RGK_FixedWidthVector;
   ElementCount MaxVF = MaxVectorElementCount;
   if (MaximizeBandwidth || (MaximizeBandwidth.getNumOccurrences() == 0 &&
-                            TTI.shouldMaximizeVectorBandwidth(RegKind))) {
+                            (TTI.shouldMaximizeVectorBandwidth(RegKind) ||
+                             Legal->hasVectorVariants()))) {
----------------
david-arm wrote:

If you agree with my suggestions above you can rewrite this as:

TTI.shouldMaximizeVectorBandwidth(RegKind) ||
 (UseWiderVFIfVariantsPresent && Legal->hasVectorVariants())


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


More information about the llvm-commits mailing list