Skip to content
Snippets Groups Projects
Commit d121635f authored by Dehao Chen's avatar Dehao Chen
Browse files

Remove InstructionCombining and its related pass from sample pgo passes as we...

Remove InstructionCombining and its related pass from sample pgo passes as we can handle "invoke" correctly.

Summary: We previously relies on InstructionCombining pass to remove invoke instructions. Now that we can inline invoke instructions correctly, we do not need these passes any more.

Reviewers: dnovillo

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D24730

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281910 91177308-0d34-0410-b5e6-96231b3b80d8
parent 4e150257
No related branches found
No related tags found
No related merge requests found
......@@ -149,17 +149,6 @@ static void addAddDiscriminatorsPass(const PassManagerBuilder &Builder,
PM.add(createAddDiscriminatorsPass());
}
static void addCleanupPassesForSampleProfiler(
const PassManagerBuilder &Builder, legacy::PassManagerBase &PM) {
// instcombine is needed before sample profile annotation because it converts
// certain function calls to be inlinable. simplifycfg and sroa are needed
// before instcombine for necessary preparation. E.g. load store is eliminated
// properly so that instcombine will not introduce unecessary liverange.
PM.add(createCFGSimplificationPass());
PM.add(createSROAPass());
PM.add(createInstructionCombiningPass());
}
static void addBoundsCheckingPass(const PassManagerBuilder &Builder,
legacy::PassManagerBase &PM) {
PM.add(createBoundsCheckingPass());
......@@ -464,8 +453,6 @@ void EmitAssemblyHelper::CreatePasses(legacy::PassManager &MPM,
if (!CodeGenOpts.SampleProfileFile.empty()) {
MPM.add(createPruneEHPass());
MPM.add(createSampleProfileLoaderPass(CodeGenOpts.SampleProfileFile));
PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
addCleanupPassesForSampleProfiler);
}
PMBuilder.populateFunctionPassManager(FPM);
......
......@@ -2,8 +2,5 @@
//
// 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: Simplify the CFG
// CHECK: SROA
// CHECK: Combine redundant instructions
// CHECK: Remove unused exception handling info
// CHECK: Sample profile pass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment