Index: lib/CodeGen/BackendUtil.cpp =================================================================== --- lib/CodeGen/BackendUtil.cpp +++ lib/CodeGen/BackendUtil.cpp @@ -488,6 +488,7 @@ PMBuilder.PGOInstrUse = CodeGenOpts.ProfileInstrumentUsePath; if (!CodeGenOpts.SampleProfileFile.empty()) { + MPM->add(createPruneEHPass()); MPM->add(createSampleProfileLoaderPass(CodeGenOpts.SampleProfileFile)); PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible, addInstructionCombiningPass);