[llvm-branch-commits] [TRI] Remove reserved registers in getRegPressureSetLimit (PR #211743)
Pengcheng Wang via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jul 24 00:50:27 PDT 2026
https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/211743
There are two `getRegPressureSetLimit`:
1. `RegisterClassInfo::getRegPressureSetLimit`.
2. `TargetRegisterInfo::getRegPressureSetLimit`.
`RegisterClassInfo::getRegPressureSetLimit` is a wrapper of
`TargetRegisterInfo::getRegPressureSetLimit` with some logics to
adjust the limit by removing reserved registers.
It seems that we shouldn't use `TargetRegisterInfo::getRegPressureSetLimit`
directly, just like the comment "This limit must be adjusted
dynamically for reserved registers" said.
These two `getRegPressureSetLimit`s are messy, and easy to confuse
the users. So here we move the logic of adjusting these limits for
reserved registers in `RegisterClassInfo::getRegPressureSetLimit`
to `TargetRegisterInfo::getRegPressureSetLimit`. This makes the previous
one a thin cached wrapper of the later one.
This is another attempt of #118787.
More information about the llvm-branch-commits
mailing list