diff options
author | Dehao Chen <dehao@google.com> | 2016-12-14 16:49:34 +0000 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2016-12-14 16:49:34 +0000 |
commit | a37569927b0fe3fb2544ec496b2ac68dada0e4a9 (patch) | |
tree | 08b51993a2d5dca6b40e9da90acdecad1a6ccb9f /clang/lib/CodeGen | |
parent | cb61c94d87abb55ff00472266ea3fffce305f5bc (diff) | |
download | bcm5719-llvm-a37569927b0fe3fb2544ec496b2ac68dada0e4a9.tar.gz bcm5719-llvm-a37569927b0fe3fb2544ec496b2ac68dada0e4a9.zip |
Create SampleProfileLoader pass in llvm instead of clang
Summary:
We used to create SampleProfileLoader pass in clang. This makes LTO/ThinLTO unable to add this pass in the linker plugin. This patch moves the SampleProfileLoader pass creation from
clang to llvm pass manager builder.
Reviewers: tejohnson, davidxl, dnovillo
Subscribers: mehdi_amini, cfe-commits
Differential Revision: https://reviews.llvm.org/D27744
llvm-svn: 289670
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/BackendUtil.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index cef7485446a..0b72dc93932 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -464,10 +464,8 @@ void EmitAssemblyHelper::CreatePasses(legacy::PassManager &MPM, if (CodeGenOpts.hasProfileIRUse()) PMBuilder.PGOInstrUse = CodeGenOpts.ProfileInstrumentUsePath; - if (!CodeGenOpts.SampleProfileFile.empty()) { - MPM.add(createPruneEHPass()); - MPM.add(createSampleProfileLoaderPass(CodeGenOpts.SampleProfileFile)); - } + if (!CodeGenOpts.SampleProfileFile.empty()) + PMBuilder.PGOSampleUse = CodeGenOpts.SampleProfileFile; PMBuilder.populateFunctionPassManager(FPM); PMBuilder.populateModulePassManager(MPM); |