aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Passes
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2024-04-18 11:22:10 -0700
committerGitHub <noreply@github.com>2024-04-18 11:22:10 -0700
commit947b656add053a8c9a36cab27b5c6e8eb9c426f7 (patch)
tree3ac96173a63fad53b0983cc6a1feafc63d506511 /llvm/lib/Passes
parent22ed10d11e3ed5179e21a59cfa78b8318d1e1665 (diff)
downloadllvm-947b656add053a8c9a36cab27b5c6e8eb9c426f7.zip
llvm-947b656add053a8c9a36cab27b5c6e8eb9c426f7.tar.gz
llvm-947b656add053a8c9a36cab27b5c6e8eb9c426f7.tar.bz2
[PGO] Check that PGOOpt exists before using PGOOpt->ColdOptType (#89139)
This means that the pass is unusable without some sort of profile. We can revisit this decision later if we want to support running this pass without a profile.
Diffstat (limited to 'llvm/lib/Passes')
-rw-r--r--llvm/lib/Passes/PassBuilderPipelines.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp
index 3bb2ce0..90ba3b5 100644
--- a/llvm/lib/Passes/PassBuilderPipelines.cpp
+++ b/llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -1169,7 +1169,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
if (EnableSyntheticCounts && !PGOOpt)
MPM.addPass(SyntheticCountsPropagation());
- if (EnablePGOForceFunctionAttrs)
+ if (EnablePGOForceFunctionAttrs && PGOOpt)
MPM.addPass(PGOForceFunctionAttrsPass(PGOOpt->ColdOptType));
MPM.addPass(AlwaysInlinerPass(/*InsertLifetimeIntrinsics=*/true));