Skip to content

Commit 012d80c

Browse files
committed
Fix segfault when running ompss pass from clang
Seems like EP_EarlyAsPossible can only be used for FunctionPasses. Let's do what https://lists.llvm.org/pipermail/llvm-dev/2018-June/123988.html says and add the pass with EP_ModuleOptimizerEarly and EP_ModuleOptimizerEarly
1 parent c39b5ea commit 012d80c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,9 @@ void EmitAssemblyHelper::CreatePasses(legacy::PassManager &MPM,
570570
TM->adjustPassManager(PMBuilder);
571571

572572
if (LangOpts.OmpSs) {
573-
PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
573+
PMBuilder.addExtension(PassManagerBuilder::EP_ModuleOptimizerEarly,
574+
addOmpSsPass);
575+
PMBuilder.addExtension(PassManagerBuilder::EP_EnabledOnOptLevel0,
574576
addOmpSsPass);
575577
}
576578

0 commit comments

Comments
 (0)