[llvm] X86: Stop overriding getRegClass (PR #155128)
Shengchen Kan via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 24 06:23:43 PDT 2025
KanRobert wrote:
> > It seems this PR should not only remove the overriding. If there is an alternative/better way to achieve that
>
> The original PR already reserved these registers
>
> > > it should probably generalize the LookupPtrRegClass mechanism.
> >
> >
> > , it should be included too, otherwise there is a correctness issue.
>
> That would be necessary if the underlying class fundamentally changed (e.g. 32-bit to 64-bit), but this just swapping to a different subset, which also aligns with the reserved registers so I don't think there's anything to do here.
It's different from the logic of reserved registers, which does not depend on the instruction itself. Here we have the check
```
X86II::canUseApxExtendedReg(MCID)
```
b/c even when feature APX/EGPR is on, some instructions can not use R16-R31.
https://github.com/llvm/llvm-project/pull/155128
More information about the llvm-commits
mailing list