[llvm] [LoopVectorize][NFC] Cache the result of getVScaleForTuning (PR #124732)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 12:39:35 PST 2025


================
@@ -3838,6 +3861,11 @@ FixedScalableVFPair LoopVectorizationCostModel::computeFeasibleMaxVF(
   if (!Legal->isSafeForAnyVectorWidth())
     this->MaxSafeElements = MaxSafeElements;
 
+  if (MaxSafeScalableVF != ElementCount::getScalable(0)) {
+    // Cache the value of vscale for tuning, since we'll need it.
+    initializeVScaleForTuning();
----------------
fhahn wrote:

> I'm not sure I follow. Are you worried about us initialising VScaleForTuning twice

More about calling it before it was initialized, thanks for the update

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


More information about the llvm-commits mailing list