[llvm] [mlir] [MLGO] Do not hardcode 33 eviction feature columns (PR #224598)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 17:06:31 PDT 2026


================
@@ -812,9 +854,11 @@ MCRegister MLEvictAdvisor::tryFindEvictionCandidate(
        ++FeatureIndex) {
     if (DoNotNormalize.test(FeatureIndex))
       continue;
+    // Skip the columns past ValidPosLimit: never written, so still 0.
     float *Tensor = Runner->getTensor<float>(FeatureIndex);
-    for (size_t Pos = 0; Pos < NumColumns; ++Pos)
-      Tensor[Pos] /= Largest[FeatureIndex];
+    for (size_t P = 0; P < ValidPosLimit; ++P)
----------------
mtrofin wrote:

I realize they aren't written, but the original code's goal was to keep it simpler in that it performed a whole swoop over the Tensor vector.

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


More information about the llvm-commits mailing list