Skip to content

Commit d7c1427

Browse files
committed
Revert "[LegacyPM] Remove cl::opts controlling optimization pass manager passes"
This reverts commit 7ec05fe. Breaks bots, e.g. https://lab.llvm.org/buildbot#builders/217/builds/15008
1 parent 7ec05fe commit d7c1427

File tree

2 files changed

+280
-98
lines changed

2 files changed

+280
-98
lines changed

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 24 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ static cl::opt<InliningAdvisorMode> UseInlineAdvisor(
134134
"enable-ml-inliner", cl::init(InliningAdvisorMode::Default), cl::Hidden,
135135
cl::desc("Enable ML policy for inliner. Currently trained for -Oz only"),
136136
cl::values(clEnumValN(InliningAdvisorMode::Default, "default",
137-
"Heuristics-based inliner version"),
137+
"Heuristics-based inliner version."),
138138
clEnumValN(InliningAdvisorMode::Development, "development",
139-
"Use development mode (runtime-loadable model)"),
139+
"Use development mode (runtime-loadable model)."),
140140
clEnumValN(InliningAdvisorMode::Release, "release",
141-
"Use release mode (AOT-compiled model)")));
141+
"Use release mode (AOT-compiled model).")));
142142

143143
static cl::opt<bool> EnableSyntheticCounts(
144144
"enable-npm-synthetic-counts", cl::Hidden,
@@ -161,7 +161,7 @@ static cl::opt<bool> EnableModuleInliner("enable-module-inliner",
161161
static cl::opt<bool> PerformMandatoryInliningsFirst(
162162
"mandatory-inlining-first", cl::init(true), cl::Hidden,
163163
cl::desc("Perform mandatory inlinings module-wide, before performing "
164-
"inlining"));
164+
"inlining."));
165165

166166
static cl::opt<bool> EnableO3NonTrivialUnswitching(
167167
"enable-npm-O3-nontrivial-unswitch", cl::init(true), cl::Hidden,
@@ -190,99 +190,6 @@ static cl::opt<bool> EnableGlobalAnalyses(
190190
"enable-global-analyses", cl::init(true), cl::Hidden,
191191
cl::desc("Enable inter-procedural analyses"));
192192

193-
static cl::opt<bool>
194-
RunPartialInlining("enable-partial-inlining", cl::init(false), cl::Hidden,
195-
cl::desc("Run Partial inlinining pass"));
196-
197-
static cl::opt<bool> ExtraVectorizerPasses(
198-
"extra-vectorizer-passes", cl::init(false), cl::Hidden,
199-
cl::desc("Run cleanup optimization passes after vectorization"));
200-
201-
static cl::opt<bool> RunNewGVN("enable-newgvn", cl::init(false), cl::Hidden,
202-
cl::desc("Run the NewGVN pass"));
203-
204-
static cl::opt<bool> EnableLoopInterchange(
205-
"enable-loopinterchange", cl::init(false), cl::Hidden,
206-
cl::desc("Enable the experimental LoopInterchange Pass"));
207-
208-
static cl::opt<bool> EnableUnrollAndJam("enable-unroll-and-jam",
209-
cl::init(false), cl::Hidden,
210-
cl::desc("Enable Unroll And Jam Pass"));
211-
212-
static cl::opt<bool> EnableLoopFlatten("enable-loop-flatten", cl::init(false),
213-
cl::Hidden,
214-
cl::desc("Enable the LoopFlatten Pass"));
215-
216-
static cl::opt<bool>
217-
EnableDFAJumpThreading("enable-dfa-jump-thread",
218-
cl::desc("Enable DFA jump threading"),
219-
cl::init(false), cl::Hidden);
220-
221-
static cl::opt<bool>
222-
EnableHotColdSplit("hot-cold-split",
223-
cl::desc("Enable hot-cold splitting pass"));
224-
225-
static cl::opt<bool> EnableIROutliner("ir-outliner", cl::init(false),
226-
cl::Hidden,
227-
cl::desc("Enable ir outliner pass"));
228-
229-
static cl::opt<bool>
230-
DisablePreInliner("disable-preinline", cl::init(false), cl::Hidden,
231-
cl::desc("Disable pre-instrumentation inliner"));
232-
233-
static cl::opt<int> PreInlineThreshold(
234-
"preinline-threshold", cl::Hidden, cl::init(75),
235-
cl::desc("Control the amount of inlining in pre-instrumentation inliner "
236-
"(default = 75)"));
237-
238-
static cl::opt<bool>
239-
EnableGVNHoist("enable-gvn-hoist",
240-
cl::desc("Enable the GVN hoisting pass (default = off)"));
241-
242-
static cl::opt<bool>
243-
EnableGVNSink("enable-gvn-sink",
244-
cl::desc("Enable the GVN sinking pass (default = off)"));
245-
246-
// This option is used in simplifying testing SampleFDO optimizations for
247-
// profile loading.
248-
static cl::opt<bool>
249-
EnableCHR("enable-chr", cl::init(true), cl::Hidden,
250-
cl::desc("Enable control height reduction optimization (CHR)"));
251-
252-
static cl::opt<bool> FlattenedProfileUsed(
253-
"flattened-profile-used", cl::init(false), cl::Hidden,
254-
cl::desc("Indicate the sample profile being used is flattened, i.e., "
255-
"no inline hierachy exists in the profile"));
256-
257-
static cl::opt<bool> EnableOrderFileInstrumentation(
258-
"enable-order-file-instrumentation", cl::init(false), cl::Hidden,
259-
cl::desc("Enable order file instrumentation (default = off)"));
260-
261-
static cl::opt<bool>
262-
EnableMatrix("enable-matrix", cl::init(false), cl::Hidden,
263-
cl::desc("Enable lowering of the matrix intrinsics"));
264-
265-
static cl::opt<bool> EnableConstraintElimination(
266-
"enable-constraint-elimination", cl::init(false), cl::Hidden,
267-
cl::desc(
268-
"Enable pass to eliminate conditions based on linear constraints"));
269-
270-
static cl::opt<bool> EnableFunctionSpecialization(
271-
"enable-function-specialization", cl::init(false), cl::Hidden,
272-
cl::desc("Enable Function Specialization pass"));
273-
274-
static cl::opt<AttributorRunOption> AttributorRun(
275-
"attributor-enable", cl::Hidden, cl::init(AttributorRunOption::NONE),
276-
cl::desc("Enable the attributor inter-procedural deduction pass"),
277-
cl::values(clEnumValN(AttributorRunOption::ALL, "all",
278-
"enable all attributor runs"),
279-
clEnumValN(AttributorRunOption::MODULE, "module",
280-
"enable module-wide attributor runs"),
281-
clEnumValN(AttributorRunOption::CGSCC, "cgscc",
282-
"enable call graph SCC attributor runs"),
283-
clEnumValN(AttributorRunOption::NONE, "none",
284-
"disable attributor runs")));
285-
286193
PipelineTuningOptions::PipelineTuningOptions() {
287194
LoopInterleaving = true;
288195
LoopVectorization = true;
@@ -299,7 +206,27 @@ PipelineTuningOptions::PipelineTuningOptions() {
299206

300207
namespace llvm {
301208
extern cl::opt<unsigned> MaxDevirtIterations;
209+
extern cl::opt<bool> EnableConstraintElimination;
210+
extern cl::opt<bool> EnableFunctionSpecialization;
211+
extern cl::opt<bool> EnableGVNHoist;
212+
extern cl::opt<bool> EnableGVNSink;
213+
extern cl::opt<bool> EnableHotColdSplit;
214+
extern cl::opt<bool> EnableIROutliner;
215+
extern cl::opt<bool> EnableOrderFileInstrumentation;
216+
extern cl::opt<bool> EnableCHR;
217+
extern cl::opt<bool> EnableLoopInterchange;
218+
extern cl::opt<bool> EnableUnrollAndJam;
219+
extern cl::opt<bool> EnableLoopFlatten;
220+
extern cl::opt<bool> EnableDFAJumpThreading;
221+
extern cl::opt<bool> RunNewGVN;
222+
extern cl::opt<bool> RunPartialInlining;
223+
extern cl::opt<bool> ExtraVectorizerPasses;
224+
extern cl::opt<bool> FlattenedProfileUsed;
225+
extern cl::opt<AttributorRunOption> AttributorRun;
302226
extern cl::opt<bool> EnableKnowledgeRetention;
227+
extern cl::opt<bool> EnableMatrix;
228+
extern cl::opt<bool> DisablePreInliner;
229+
extern cl::opt<int> PreInlineThreshold;
303230
} // namespace llvm
304231

305232
void PassBuilder::invokePeepholeEPCallbacks(FunctionPassManager &FPM,

0 commit comments

Comments
 (0)