summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Lanza <nathanlanza@gmail.com>2024-04-27 23:25:47 +0000
committerNathan Lanza <nathanlanza@gmail.com>2024-04-27 23:25:47 +0000
commit874904094f3c098f77dcdae73cedeb00d20489b6 (patch)
treec07a7d1da7d2532cf00a5a66d19134a27b05b46d
parentff03f23be8bc6df701efd9e1093779fbcf382d87 (diff)
Created using spr 1.3.5
-rw-r--r--llvm/lib/Passes/PassBuilderPipelines.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp
index 90ba3b541553..683aecf49cc2 100644
--- a/llvm/lib/Passes/PassBuilderPipelines.cpp
+++ b/llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -298,6 +298,11 @@ static cl::opt<bool> UseLoopVersioningLICM(
"enable-loop-versioning-licm", cl::init(false), cl::Hidden,
cl::desc("Enable the experimental Loop Versioning LICM pass"));
+static cl::opt<bool> DisableFullLTOPrelinkOptimization(
+ "disable-full-lto-prelink-optimization", cl::init(false), cl::Hidden,
+ cl::desc("Disable the module optimization pipeline for the FullLTO prelink "
+ "pipeline"));
+
namespace llvm {
extern cl::opt<bool> EnableMemProfContextDisambiguation;
@@ -1553,7 +1558,9 @@ PassBuilder::buildPerModuleDefaultPipeline(OptimizationLevel Level,
MPM.addPass(buildModuleSimplificationPipeline(Level, LTOPhase));
// Now add the optimization pipeline.
- MPM.addPass(buildModuleOptimizationPipeline(Level, LTOPhase));
+ if (LTOPhase != ThinOrFullLTOPhase::FullLTOPreLink ||
+ !DisableFullLTOPrelinkOptimization)
+ MPM.addPass(buildModuleOptimizationPipeline(Level, LTOPhase));
if (PGOOpt && PGOOpt->PseudoProbeForProfiling &&
PGOOpt->Action == PGOOptions::SampleUse)