Skip to content

Commit a30a907

Browse files
macurtis-amdronlieb
authored andcommitted
[llvm] Add pass builder option '-enable-early-openmp-opt'
Change-Id: I55a8c76e10bb1c771a11442cb5ecab074ccb4fa6
1 parent 484bc15 commit a30a907

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,11 @@ cl::opt<std::string>
309309
UseCtxProfile("use-ctx-profile", cl::init(""), cl::Hidden,
310310
cl::desc("Use the specified contextual profile file"));
311311

312+
static cl::opt<bool> EnableEarlyOpenMPOpt(
313+
"enable-early-openmp-opt", cl::init(false), cl::Hidden,
314+
cl::desc("Enable early execution of the OpenMP optimization pass"
315+
" (default = off)"));
316+
312317
namespace llvm {
313318
extern cl::opt<bool> EnableMemProfContextDisambiguation;
314319

@@ -1081,6 +1086,10 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
10811086
// frontend. Not necessary with LTO post link pipelines since the pre link
10821087
// pipeline already cleaned up the frontend output.
10831088
if (Phase != ThinOrFullLTOPhase::ThinLTOPostLink) {
1089+
1090+
if (EnableEarlyOpenMPOpt)
1091+
MPM.addPass(OpenMPOptPass());
1092+
10841093
// Do basic inference of function attributes from known properties of system
10851094
// libraries and other oracles.
10861095
MPM.addPass(InferFunctionAttrsPass());

0 commit comments

Comments
 (0)