Index: lib/Passes/PassBuilder.cpp =================================================================== --- lib/Passes/PassBuilder.cpp +++ lib/Passes/PassBuilder.cpp @@ -362,6 +362,10 @@ invokePeepholeEPCallbacks(FPM, Level); + if (PGOOpt && !isOptimizingForSize(Level) && + !PGOOpt->SampleProfileFile.empty()) + FPM.addPass(PGOMemOPSizeOpt()); + FPM.addPass(TailCallElimPass()); FPM.addPass(SimplifyCFGPass());