This is the union of patch 1 and patch 2 of the RFCdescribed by the LLVM-dev RFC "MC support for variant scheduling classes".
This patch introduces method `resolveVariantSchedClass()` in `MCSubtargetInfo`.
A follow-up llvm-mca patch will be able to use that method to solve variant scheduling classes.