forked from OSchip/llvm-project
Invoke PruneEH pass before Sample Profile pass.
Summary: We need to call PruneEH pass before AutoFDO pass so that some EH-related calls can get inlined in Sample Profile pass. Reviewers: davidxl, dnovillo Subscribers: junbuml, llvm-commits Differential Revision: http://reviews.llvm.org/D21197 llvm-svn: 273298
This commit is contained in:
parent
c76f9f0df8
commit
1997d8684f
|
@ -488,6 +488,7 @@ void EmitAssemblyHelper::CreatePasses(ModuleSummaryIndex *ModuleSummary) {
|
|||
PMBuilder.PGOInstrUse = CodeGenOpts.ProfileInstrumentUsePath;
|
||||
|
||||
if (!CodeGenOpts.SampleProfileFile.empty()) {
|
||||
MPM->add(createPruneEHPass());
|
||||
MPM->add(createSampleProfileLoaderPass(CodeGenOpts.SampleProfileFile));
|
||||
PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
|
||||
addInstructionCombiningPass);
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
bar:100:100
|
||||
1: 2000
|
|
@ -0,0 +1,6 @@
|
|||
// Test if PGO sample use passes are invoked.
|
||||
//
|
||||
// Ensure Pass PGOInstrumentationGenPass is invoked.
|
||||
// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s
|
||||
// CHECK: Remove unused exception handling info
|
||||
// CHECK: Sample profile pass
|
Loading…
Reference in New Issue