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

Arseniy Obolenskiy llvmlistbot at llvm.org
Sun Oct 4 21:14:07 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) {
----------------
aobolensk wrote:

The allocation order can now be longer than the column count (not on x86 tho), without the check we would write past the end of the tensors

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


More information about the Mlir-commits mailing list