I'm only just beginning to understand the TableGen backends. Craig is correct that the sorting is done with LessRecordRegister. I think you obtain the actual register numbers with some feature of the dwarf facility. But I hope someone in the know will tell you more.