diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp --- a/llvm/lib/LTO/LTOBackend.cpp +++ b/llvm/lib/LTO/LTOBackend.cpp @@ -46,6 +46,9 @@ #include "llvm/Transforms/Scalar/LoopPassManager.h" #include "llvm/Transforms/Utils/FunctionImportUtils.h" #include "llvm/Transforms/Utils/SplitModule.h" +#ifdef __FACEBOOK__ +#include "pika/CodeGen/MIRProfileSummary.h" +#endif // __FACEBOOK__ using namespace llvm; using namespace lto; @@ -528,6 +531,9 @@ std::unique_ptr TM = createTargetMachine(C, *TOrErr, *Mod); +#ifdef __FACEBOOK__ + MIRProfileSummary::parseProfile(); +#endif if (!C.CodeGenOnly) { if (!opt(C, TM.get(), 0, *Mod, /*IsThinLTO=*/false, /*ExportSummary=*/&CombinedIndex, /*ImportSummary=*/nullptr, @@ -541,6 +547,10 @@ splitCodeGen(C, TM.get(), AddStream, ParallelCodeGenParallelismLevel, std::move(Mod), CombinedIndex); } +#ifdef __FACEBOOK__ + std::vector temp; + MIRProfileSummary::publishFinalOrderedSymbols(temp); +#endif return Error::success(); }