This was getting chosen as the preferred 32-bit register class based
on how TableGen selects subregister classes.
Details
Diff Detail
Event Timeline
lib/Target/AMDGPU/SIRegisterInfo.td | ||
---|---|---|
685 | VReg_1 should never be seen by a spill. This could also be rounded when spilling |
lib/Target/AMDGPU/SIRegisterInfo.td | ||
---|---|---|
685 | Why are you sure it will never be spilled? |
lib/Target/AMDGPU/SIRegisterInfo.td | ||
---|---|---|
685 | Because this is a hack that exists for SelectionDAG. All uses should be eliminated in SILowerI1Copies. It matters because TableGen uses this as one of the sort and selection field. Without it, it picks VReg_1 instead of VGPR_32 as the preferred 32-bit register class |
lib/Target/AMDGPU/SIRegisterInfo.td | ||
---|---|---|
685 | OK, makes sense. What about SReg_1 handling in the comment above, in the isRegister32()? |
lib/Target/AMDGPU/SIRegisterInfo.td | ||
---|---|---|
685 | Contextually, I think that would already be illegal so I don't think this assert should worry about it. That would be a VGPR->SGPR copy that would error elsewhere |
lib/Target/AMDGPU/SIRegisterInfo.td | ||
---|---|---|
685 | Assert probably fine, but the function is called isRegister32 and someone may eventually want to reuse it with unexpected consequences. |
SReg_1 is also 1 bit, but not necessarily 32 on spill.