Context-sensitive profile effectively split a function profile into many copies each representing the CFG profile of a particular calling context. That makes the count distribution looks more flat as we now have more function profiles each with lower counts, which in turn leads to lower hot thresholds. Now we tells threshold computation to merge context profile first before calculating percentile based cutoffs to compensate for seemingly flat context profile. This can be controlled by swtich sample-profile-contextless-threshold.
Earlier measurement showed ~0.4% perf boost with this tuning on spec2k6 for CSSPGO (with pseudo-probe and new inliner).
ProfileMap --> *ProfilesToUse here?
Actually the computeSummary in the Reader and the Writer are mostly the same. It is better to extract them and make it a shared function somewhere, for example in SampleProfileBuilder.