[NFC] In D152399, we calculate BPI->BFI in MachineFunctionSplit pass just to use PSI->isFunctionHotInCallGraph, which is expensive. Instead, we can implement this directly with MBFI.
Reviewer @wenlei mentioned in his commet, that machine_size_opts already has isFunctionColdInCallGraph, isFunctionHotInCallGraphNthPercentile, etc implemented. These can be refactored and reused across MFS and machine size opts.
This CL does this - it refactors out those internal static functions into PSI as templated functions, so they can be accessed easily.
Now with PSI directly supporting IR and MIR, do we still need MachineBasicBlockBFIAdapter?
This function below (main use of adapter) can now interface with templated PSI APIs (isHotBlockNthPercentile/isColdBlockNthPercentile/isColdBlock) directly without going through adapter.