The sort of the elements in the GET_SUBTARGETINFO_MACRO block is done on the "Name" field of each record. This field is not guaranteed to be unique, is not guaranteed to even have a value at all, and is not used in the output anyway. Change to sort on the "Attribute" field which should be unique.
Problem spotted when lib/Target/PowerPC/PPCGenSubtargetInfo.inc changed unexpectedly.
Probably could keep this in SubtargetEmitter.cpp? Doesn't seem generically useful.