@@ -57,9 +57,10 @@ static cl::opt<double>
57
57
cl::desc (" Multiply all ratios by this factor" ), cl::init(1.0 ),
58
58
cl::ReallyHidden);
59
59
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.
63
64
ErrorOr<double > UnpredictableProfileLoaderPass::getMispredictRatio (
64
65
const FunctionSamples *FuncFreqSamples,
65
66
const FunctionSamples *FuncMispSamples, const Instruction *I) {
@@ -101,8 +102,9 @@ ErrorOr<double> UnpredictableProfileLoaderPass::getMispredictRatio(
101
102
return MissRatio;
102
103
}
103
104
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.
106
108
bool UnpredictableProfileLoaderPass::addUpredictableMetadata (Function &F) {
107
109
108
110
const FunctionSamples *FreqSamples = FreqReader->getSamplesFor (F);
0 commit comments