@@ -57,9 +57,10 @@ static cl::opt<double>
5757 cl::desc (" Multiply all ratios by this factor" ), cl::init(1.0 ),
5858 cl::ReallyHidden);
5959
60- // Lookup samples for an Instruction's corresponding location in a
61- // FunctionSamples profile. The count returned is directly from the profile
62- // representing the number of samples seen.
60+ // Lookup execution frequency and mispredict samples for an Instruction's
61+ // corresponding location in a the two FunctionSamples profiles and compute an
62+ // effective branch mispredict ratio. The counts used to compute the ratio are
63+ // uint64s read directly from the profile files.
6364ErrorOr<double > UnpredictableProfileLoaderPass::getMispredictRatio (
6465 const FunctionSamples *FuncFreqSamples,
6566 const FunctionSamples *FuncMispSamples, const Instruction *I) {
@@ -101,8 +102,9 @@ ErrorOr<double> UnpredictableProfileLoaderPass::getMispredictRatio(
101102 return MissRatio;
102103}
103104
104- // Examine all Select and BranchInsts in a function, adding !unpredictable
105- // metadata if they appear in the mispredict profile with sufficient weight.
105+ // Examine all Branch, Select, and SwitchInsts in a function, adding
106+ // !unpredictable metadata if they appear in the mispredict profile with
107+ // sufficient weight.
106108bool UnpredictableProfileLoaderPass::addUpredictableMetadata (Function &F) {
107109
108110 const FunctionSamples *FreqSamples = FreqReader->getSamplesFor (F);
0 commit comments