[llvm-exegesis] getNonRedundantWriteProcRes - perform basic toplogical sorting (PR58500)
getNonRedundantWriteProcRes was assuming that tblgen topologically sorted the cpu ModelProcResources[] arrays so that resource units were declared before the resource groups that used them, but unfortunately that doesn't appear to be true - in most cases it was just getting lucky based off the alphanumeric sorting that was being performed and the choice of the resource pipe names in most scheduler models (Intel models in particular).
This patch adds an explicit sort, based off llvm-mca's initializeUsedResources, that sorts by resource mask - I'm hoping this basic sorting is enough, I don't think overlapping groups or Super resources are a problem.
I'd like to take this further in the future and start sharing more code between llvm-mca and llvm-exegesis - while triaging this bug I saw how similar both approaches are, but are just dissimilar enough that any refactor isn't going to be trivial :(
Working with @courbet on a follow up unit test
Fixes #58500
Fixes #37045
Differential Revision: https://reviews.llvm.org/D136351