diff options
author | Dehao Chen <dehao@google.com> | 2016-12-14 21:41:04 +0000 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2016-12-14 21:41:04 +0000 |
commit | 5717aff105cc5d5a52604d39d1f5c83e16862f8b (patch) | |
tree | f0df9e152a8526b46279cdb1c0b67a3804adf8f1 /clang/lib/CodeGen | |
parent | a99e082e15422bb2666532001bca76dbe30468bf (diff) | |
download | bcm5719-llvm-5717aff105cc5d5a52604d39d1f5c83e16862f8b.tar.gz bcm5719-llvm-5717aff105cc5d5a52604d39d1f5c83e16862f8b.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: 289715
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); |