diff options
author | Dehao Chen <dehao@google.com> | 2017-07-29 04:10:24 +0000 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2017-07-29 04:10:24 +0000 |
commit | ce0842ce9cd73f71697c4383a75a9b1aa607271e (patch) | |
tree | 9596acd7950d5196fb5393a42e2825b257e31ac2 /llvm/include/llvm/Passes/PassBuilder.h | |
parent | 503fd446adcfacda0636f1eca473d997ca0b660a (diff) | |
download | bcm5719-llvm-ce0842ce9cd73f71697c4383a75a9b1aa607271e.tar.gz bcm5719-llvm-ce0842ce9cd73f71697c4383a75a9b1aa607271e.zip |
Refine the PGOOpt and SamplePGOSupport handling.
Summary:
Now that SamplePGOSupport is part of PGOOpt, there are several places that need tweaking:
1. AddDiscriminator pass should *not* be invoked at ThinLTOBackend (as it's already invoked in the PreLink phase)
2. addPGOInstrPasses should only be invoked when either ProfileGenFile or ProfileUseFile is non-empty.
3. SampleProfileLoaderPass should only be invoked when SampleProfileFile is non-empty.
4. PGOIndirectCallPromotion should only be invoked in ProfileUse phase, or in ThinLTOBackend of SamplePGO.
Reviewers: chandlerc, tejohnson, davidxl
Reviewed By: chandlerc
Subscribers: sanjoy, mehdi_amini, eraman, llvm-commits
Differential Revision: https://reviews.llvm.org/D36040
llvm-svn: 309478
Diffstat (limited to 'llvm/include/llvm/Passes/PassBuilder.h')
-rw-r--r-- | llvm/include/llvm/Passes/PassBuilder.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/include/llvm/Passes/PassBuilder.h b/llvm/include/llvm/Passes/PassBuilder.h index 5756f49752b..0502913e7fb 100644 --- a/llvm/include/llvm/Passes/PassBuilder.h +++ b/llvm/include/llvm/Passes/PassBuilder.h @@ -34,7 +34,12 @@ struct PGOOptions { bool SamplePGOSupport = false) : ProfileGenFile(ProfileGenFile), ProfileUseFile(ProfileUseFile), SampleProfileFile(SampleProfileFile), RunProfileGen(RunProfileGen), - SamplePGOSupport(SamplePGOSupport || !SampleProfileFile.empty()) {} + SamplePGOSupport(SamplePGOSupport || !SampleProfileFile.empty()) { + assert((RunProfileGen || + !SampleProfileFile.empty() || + !ProfileUseFile.empty() || + SamplePGOSupport) && "Illegal PGOOptions."); + } std::string ProfileGenFile; std::string ProfileUseFile; std::string SampleProfileFile; |