80 bool isFunctionColdInCallGraph(
87 for (
const auto &
MBB : *MF)
95 bool isFunctionHotInCallGraphNthPercentile(
102 FunctionCount->getCount()))
104 for (
const auto &
MBB : *MF)
110 bool isFunctionColdInCallGraphNthPercentile(
115 FunctionCount->getCount()))
117 for (
const auto &
MBB : *MF)
124 struct MachineBasicBlockBFIAdapter {
128 return machine_size_opts_detail::isFunctionColdInCallGraph(MF, PSI, MBFI);
130 static bool isFunctionHotInCallGraphNthPercentile(
135 return machine_size_opts_detail::isFunctionHotInCallGraphNthPercentile(
136 CutOff, MF, PSI, MBFI);
138 static bool isFunctionColdInCallGraphNthPercentile(
141 return machine_size_opts_detail::isFunctionColdInCallGraphNthPercentile(
142 CutOff, MF, PSI, MBFI);
154 static bool isHotBlockNthPercentile(
int CutOff,
158 return machine_size_opts_detail::isHotBlockNthPercentile(
159 CutOff,
MBB, PSI, MBFI);
161 static bool isHotBlockNthPercentile(
int CutOff,
165 return machine_size_opts_detail::isHotBlockNthPercentile(
166 CutOff, BlockFreq, PSI, MBFI);
171 return machine_size_opts_detail::isColdBlockNthPercentile(CutOff,
MBB, PSI,
174 static bool isColdBlockNthPercentile(
int CutOff,
BlockFrequency BlockFreq,
177 return machine_size_opts_detail::isColdBlockNthPercentile(CutOff, BlockFreq,
187 return shouldFuncOptimizeForSizeImpl<MachineBasicBlockBFIAdapter>(
188 MF, PSI, MBFI, QueryType);
196 return shouldOptimizeForSizeImpl<MachineBasicBlockBFIAdapter>(
197 MBB, PSI, MBFI, QueryType);
208 return shouldOptimizeForSizeImpl<MachineBasicBlockBFIAdapter>(
209 BlockFreq, PSI, &MBFIW->
getMBFI(), QueryType);