The intent for this is to model the upper halves of EAX et al as individual entities (although not addressable). The motivation comes from the fact that modifying AX does not modify the upper half of EAX, whereas currently AX and EAX share the exact same set of register units. The same register units for both imply that writing AX overwrites EAX, which lead to issues in using RDF with the X86 backend.
Simply adding the extra registers without putting them in a register class causes compile-time assertions in TargetRegisterInfo::getMinimalPhysRegClass. With the extra registers in a register class, the pressure sets/limits change due to extra register classes synthesized by TableGen, and the resulting codegen is different from the original.
This patch introduces a concept of "artificial" registers, which take part in register aliasing analysis, but do not cause any changes to register pressure sets/limits, etc. No additional register classes are created due to the existence of these registers or the associated subregister indexes.
To summarize the concepts:
A register in the .td file can be designated as "artificial", which means that it doesn't correspond to any physical register in the associated architecture. This may be useful for creating registers that correspond to otherwise unaddressable parts of actual (non-artificial) registers.
Within TableGen there are several other entities that be artificial: subregister index, register unit and register class.
A subregister index is artificial if it cannot be used to obtain a non-artificial register from any other non-artificial register. In other words, if all registers obtained from applying this subregister index are artificial, then the index is considered artificial.
A register unit is considered artificial if any of the root registers is artificial. Specifically, units that are explicit aliases with an artificial register are also considered artificial.
A register class is artificial if all its members (registers) are artificial.
The main point of this is to avoid changing register pressure sets and weights due to an introduction of artificial registers: artificial register units are treated as having 0 weight, artificial subregister indices will not force new register classes from being created, artificial register classes will not have any register classes derived from them.
Drat.