[llvm] X86: Stop overriding getRegClass (PR #155128)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 25 05:40:06 PDT 2025


KanRobert wrote:

> > 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.
> 
> Can you take care of this then? Consider this a post-commit review. That patch was not actually approved, and does not have adequate test coverage for this restriction

The tests updated in this PR should prove the adequate test coverage.  We can generalize `LookupPtrRegClass` to replace current implementation,  but that would require the the function `XXRegisterInfo::getPointerRegClass` to take a parameter `const MCInstrDesc &MCID`. Does it sound good to you?



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


More information about the llvm-commits mailing list