[llvm] [NFC][LoopVectorize] Introduce new getEstimatedRuntimeVF function (PR #116247)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 02:47:17 PST 2024


================
@@ -4976,11 +4973,7 @@ LoopVectorizationCostModel::selectInterleaveCount(ElementCount VF,
       MaxInterleaveCount = ForceTargetMaxVectorInterleaveFactor;
   }
 
-  unsigned EstimatedVF = VF.getKnownMinValue();
-  if (VF.isScalable()) {
-    if (std::optional<unsigned> VScale = getVScaleForTuning(TheLoop, TTI))
-      EstimatedVF *= *VScale;
-  }
+  unsigned EstimatedVF = getEstimatedRuntimeVF(TheLoop, TTI, VF);
   assert(EstimatedVF >= 1 && "Estimated VF shouldn't be less than 1");
----------------
david-arm wrote:

It's a good question. It looks like it was really just asserting that `getVScaleForTuning` returned a non-zero value. Maybe it is worth moving into `getEstimatedRuntimeVF`.

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


More information about the llvm-commits mailing list