Follow-up to the discussion in D23561: implementation of support for register classes with variable-sized registers.
Outline of the plan:
- Make register sizes, spill slot sizes and spill slot alignment be determined by feature bits from MCSubtargetInfo. At the moment, the AMD target uses the register size at that level, so this data must be available even without MachineFunction/TargetRegisterInfo/etc.
The register size and the spill slot size can actually be different (certain cases on Hexagon), and since there are cases where the intended meaning of the RC->getSize() is the register size (parts of the AMDGPU code) as well as cases where it is taken to be spill slot size (register allocation), the distinction between these two interpretations will be made explicit.
- The register size, spill slot size, and spill slot alignment will be acquired for a register class by functions from MCRegisterInfo, not from MCRegisterClass directly. These functions will also take MCSubtargetInfo as a parameter, to allow consultation with the feature bits.
- The actual format of the register class data as calculated by TableGen is not implemented in this step, and it will be done in the next step, together with the implementation of the .td syntax changes.
- This step is a NFC change to put new APIs in place. The rest of the changes should be isolated to the parts directly involved with processing the register class data, i.e. TableGen, MCRegisterInfo, and MCSubtargetInfo. It should not be committed by itself, it serves to demonstrate this part of the proposed solution.