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

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 21:04:20 PDT 2026


================
@@ -24,7 +24,8 @@
 ]
 """
 PER_REGISTER_FEATURE_LIST = ["mask"]
-NUM_REGISTERS = 33
+# Must match getRequiredNumColumns() for the target the tests run on (X86).
+NUM_REGISTERS = 37
----------------
mtrofin wrote:

32 + 1. the + 1 is for the virtual range that's candidate for allocation, which we put on the last column always. 32 is what AllocationOrder can be at most 32, it's because some out of the 36 get filtered out.

Let's do this - @boomanaiden154 wdyt - let's have the number of allocatable registers come in via a flag, by default 32 (i.e. the nr of columns would be this number + 1). Your change achieves 99.99% of what we wanted anyway - moving off hard coded values - and (iirc) enables what you wanted, too. With the flag at 32 by default, there should be no breaking changes, and the remaining thing is to figure out the right API incantation here.

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


More information about the llvm-commits mailing list