This patch adds a function called getRegPressureSetScore() to
TargetRegisterInfo. The MachineScheduler uses this when comparing
instruction that increase the register pressure of different sets
to determine which set is safer to increase.
This hook is useful for GPU targets where the number of registers in the
class is not the best metric for determing which presser set is safer to
increase.
Future work may include adding more parameters to this function, like
for example, the current pressure level of the set or the amount that
the pressure will be increased/decreased.
The "if (TryRank == CandRank)" is confusing, even more so after the rank adjustments here. I think using unsigned TryPSet, CandPSet at first and introducing unsigned TryRank, CandRank at the place of the getPressureSetScore() calls could help.