This avoids more long lists of register classes that have to be updated
every time we add a new one. NFC.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
10597–10600 | I don't like having exceptions like this, where we override the class that getSGPRClassForBitWidth would return. There are similar things in e.g. SIRegisterInfo::getEquivalentSGPRClass. Perhaps getSGPRClassForBitWidth et al should be split into two different helpers, "get allocatable class" and "get *something else* class". But I really don't understand the purpose and the naming of the SReg/VReg/AReg vs SGPR/VGPR/AGPR classes, so I'm not sure how to do that. |
llvm/lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
10597–10600 | For the VGPR and AGPR cases, I think it's a naming mistake based on how these are defined in tablegen. We ended up with the register list as VGPR_* and then the class as VReg_*s for > 32. For SGPRs, there is a distinction. SReg_* is more inclusive. SGPR_* only include number SGPRs. The various SReg_*s include different combinations of special registers like m0 and vcc or ttmp |
llvm/lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
10626–10630 | This comment is obsolete. We do support v32* since then. You probably do not need special case for 1024 here. |
llvm/lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
10597–10600 | Thanks. Perhaps we should have both getSGPRClassForBitWidth and getSRegClassForBitWidth? What about the TTMP classes? Should there be one for every SGPR class? Currently we have TTMP_32/64/128/256/512, missing 96/160/1024. | |
10626–10630 | Thanks. I committed that separately and rebased this patch. |
I don't like having exceptions like this, where we override the class that getSGPRClassForBitWidth would return. There are similar things in e.g. SIRegisterInfo::getEquivalentSGPRClass.
Perhaps getSGPRClassForBitWidth et al should be split into two different helpers, "get allocatable class" and "get *something else* class". But I really don't understand the purpose and the naming of the SReg/VReg/AReg vs SGPR/VGPR/AGPR classes, so I'm not sure how to do that.