Currently, to use PSI->isFunctionHotInCallGraph, we first need to calculate BPI->BFI, which is expensive. Instead, we can implement this directly with MBFI. Also as @wenlei mentioned in another patch review, that MachineSizeOpts already has isFunctionColdInCallGraph, isFunctionHotInCallGraphNthPercentile, etc implemented. These can be refactored and so they can be reused across MachineFunctionSplitting and MachineSizeOpts passes. This CL does this - it refactors out those internal static functions into PSI as templated functions, so they can be accessed easily. Differential Revision: https://reviews.llvm.org/D153927
2.0 KiB
2.0 KiB