Modeling different register classes with identical register sets

We’re working on a custom backend. It has a register set used for different purposes. More concretly, registers V0~V31 can be used to hold both integer and floating-point values. So we define several different register classes, for example, VGPRf32, VGPRf16, VGPRi32, VGPRi16, but they have identical register sets, V0~V31.
However, this approach is problematic when calling TargetRegisterInfo::getCommonSubClass(VGPRi32, VPGRi16) method. It always returns VGPRf16. But we expect it to return VGPRi32 or VGPRi16.
So we’re looking for a way of handling this situation, i.e. modeling different register classes with identical register sets. Anyone has ideas? Thank you.

You don’t really have different register classes and should only define one. You can just add multiple types to the singular class. The register classes should correspond to the physical machine, which just happens to be used by operations that interpret them as different types.