diff options
author | Nikita Popov <npopov@redhat.com> | 2023-02-28 10:17:03 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-02-28 11:31:29 +0100 |
commit | 43b725f83431372bb95af1dda24c17293017bb5b (patch) | |
tree | 239779ac7148a69c002012c664b1fe9ede74264f /llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp | |
parent | 3c8ddbde37d40b81dc0dee7ce61ff0b18663946e (diff) | |
download | llvm-43b725f83431372bb95af1dda24c17293017bb5b.zip llvm-43b725f83431372bb95af1dda24c17293017bb5b.tar.gz llvm-43b725f83431372bb95af1dda24c17293017bb5b.tar.bz2 |
[CHR] Do not fetch BFI without profile summary (NFCI)
Do not compute BFI if PGO is not used. This addresses the
compile-time regression from https://reviews.llvm.org/D144769.
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp index c38ec6b..83e6629 100644 --- a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp +++ b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp @@ -2080,14 +2080,14 @@ ControlHeightReductionPass::ControlHeightReductionPass() { PreservedAnalyses ControlHeightReductionPass::run( Function &F, FunctionAnalysisManager &FAM) { - auto &BFI = FAM.getResult<BlockFrequencyAnalysis>(F); - auto &DT = FAM.getResult<DominatorTreeAnalysis>(F); auto &MAMProxy = FAM.getResult<ModuleAnalysisManagerFunctionProxy>(F); auto PPSI = MAMProxy.getCachedResult<ProfileSummaryAnalysis>(*F.getParent()); // If there is no profile summary, we should not do CHR. if (!PPSI || !PPSI->hasProfileSummary()) return PreservedAnalyses::all(); auto &PSI = *PPSI; + auto &BFI = FAM.getResult<BlockFrequencyAnalysis>(F); + auto &DT = FAM.getResult<DominatorTreeAnalysis>(F); auto &RI = FAM.getResult<RegionInfoAnalysis>(F); auto &ORE = FAM.getResult<OptimizationRemarkEmitterAnalysis>(F); bool Changed = CHR(F, BFI, DT, PSI, RI, ORE).run(); |