The function getSize in MCRegisterClass and TargetRegisterClass actually refers to the size of the spill slot needed for registers from this class. This may or may not be equal to the actual size of the register, since the register's representation in memory may not be identical to the register itself.
Moreover, the comments in the MCRegisterInfo.h and TargetRegisterInfo.h explicitly state that the function getSize refers to both, the size of the register and the size of the spill slot.
This patch will provide two new member functions: getSpillSize and getRegSize in both MCRegisterClass and TargetRegisterClass, each returning only the value corresponding to the name. The existing function getSize will remain until all callers are updated to use one of the new functions.