[llvm-branch-commits] [llvm] [TRI] Remove reserved registers in getRegPressureSetLimit (PR #118787)
Pengcheng Wang via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jan 10 00:59:42 PST 2025
wangpc-pp wrote:
> > Do you know what caused the X86 changes? I don't see any uses of getRegPressureSetLimit in the X86 directory.
>
> Just checked line by line, I have no idea why X86 has some changes...
The reason may be mentally absorbing (and costed me a lot of time on debugging...): For some `RegisterClass`s, `getRawAllocationOrder` may return different orders by `OrderFunc` (which is set by `AltOrderSelect` in TableGen). We calculate the number of reserved registers first, and then calculate the number of allocatable registers. This results in higher allocatable registers, bacause the alternative allocation orders may have less registers.
We change to calculate the number of allocatable registers directly and calculate the number of reserved registers from it, the problem can be solved.
https://github.com/llvm/llvm-project/pull/118787
More information about the llvm-branch-commits
mailing list