@@ -134,13 +134,6 @@ using namespace llvm;
134
134
135
135
#define DEBUG_TYPE " asm-printer"
136
136
137
- static cl::opt<std::string> BasicBlockProfileDump (
138
- " mbb-profile-dump" , cl::Hidden,
139
- cl::desc (" Basic block profile dump for external cost modelling. If "
140
- " matching up BBs with afterwards, the compilation must be "
141
- " performed with -basic-block-sections=labels. Enabling this "
142
- " flag during in-process ThinLTO is not supported." ));
143
-
144
137
// This is a replication of fields of object::PGOAnalysisMap::Features. It
145
138
// should match the order of the fields so that
146
139
// `object::PGOAnalysisMap::Features::decode(PgoAnalysisMapFeatures.getBits())`
@@ -646,16 +639,6 @@ bool AsmPrinter::doInitialization(Module &M) {
646
639
HI.Handler ->beginModule (&M);
647
640
}
648
641
649
- if (!BasicBlockProfileDump.empty ()) {
650
- std::error_code PossibleFileError;
651
- MBBProfileDumpFileOutput = std::make_unique<raw_fd_ostream>(
652
- BasicBlockProfileDump, PossibleFileError);
653
- if (PossibleFileError) {
654
- M.getContext ().emitError (" Failed to open file for MBB Profile Dump: " +
655
- PossibleFileError.message () + " \n " );
656
- }
657
- }
658
-
659
642
return false ;
660
643
}
661
644
@@ -2026,40 +2009,6 @@ void AsmPrinter::emitFunctionBody() {
2026
2009
OutStreamer->getCommentOS () << " -- End function\n " ;
2027
2010
2028
2011
OutStreamer->addBlankLine ();
2029
-
2030
- // Output MBB ids, function names, and frequencies if the flag to dump
2031
- // MBB profile information has been set
2032
- if (MBBProfileDumpFileOutput && !MF->empty () &&
2033
- MF->getFunction ().getEntryCount ()) {
2034
- if (!MF->hasBBLabels ()) {
2035
- MF->getContext ().reportError (
2036
- SMLoc (),
2037
- " Unable to find BB labels for MBB profile dump. -mbb-profile-dump "
2038
- " must be called with -basic-block-sections=labels" );
2039
- } else {
2040
- MachineBlockFrequencyInfo &MBFI =
2041
- getAnalysis<LazyMachineBlockFrequencyInfoPass>().getBFI ();
2042
- // The entry count and the entry basic block frequency aren't the same. We
2043
- // want to capture "absolute" frequencies, i.e. the frequency with which a
2044
- // MBB is executed when the program is executed. From there, we can derive
2045
- // Function-relative frequencies (divide by the value for the first MBB).
2046
- // We also have the information about frequency with which functions
2047
- // were called. This helps, for example, in a type of integration tests
2048
- // where we want to cross-validate the compiler's profile with a real
2049
- // profile.
2050
- // Using double precision because uint64 values used to encode mbb
2051
- // "frequencies" may be quite large.
2052
- const double EntryCount =
2053
- static_cast <double >(MF->getFunction ().getEntryCount ()->getCount ());
2054
- for (const auto &MBB : *MF) {
2055
- const double MBBRelFreq = MBFI.getBlockFreqRelativeToEntryBlock (&MBB);
2056
- const double AbsMBBFreq = MBBRelFreq * EntryCount;
2057
- *MBBProfileDumpFileOutput.get ()
2058
- << MF->getName () << " ," << MBB.getBBID ()->BaseID << " ,"
2059
- << AbsMBBFreq << " \n " ;
2060
- }
2061
- }
2062
- }
2063
2012
}
2064
2013
2065
2014
// / Compute the number of Global Variables that uses a Constant.
0 commit comments