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

Mircea Trofin llvmlistbot at llvm.org
Mon Oct 5 08:50:27 PDT 2026


================
@@ -764,9 +774,9 @@ MCRegister MLEvictAdvisor::tryFindEvictionCandidate(
   // reset all the features to 0) Use Pos to capture the column we load
   // features at - in AllocationOrder order.
   size_t Pos = 0;
-  SmallVector<LRStartEndInfo, NumberOfInterferences> LRPosInfo;
-  for (auto I = Order.begin(), E = Order.getOrderLimitEnd(OrderLimit); I != E;
-       ++I, ++Pos) {
+  SmallVector<LRStartEndInfo, ExpectedMaxColumns> LRPosInfo;
+  for (auto I = Order.begin(), E = Order.getOrderLimitEnd(OrderLimit);
+       I != E && Pos < CandidateVirtRegPos; ++I, ++Pos) {
----------------
mtrofin wrote:

ack, but that would happen if the model (and/or the num registers flag) was incorrect, right? in that case, this would be a silent failure, should this be an assert or a runtime error then?

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


More information about the Mlir-commits mailing list