Skip to content

Commit c39b5ea

Browse files
committed
Sync commit: Add OmpSs pass to clang pass builder when '-fompss-2'
1 parent 4f6bbcf commit c39b5ea

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#include "llvm/Transforms/Instrumentation/MemorySanitizer.h"
5959
#include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
6060
#include "llvm/Transforms/ObjCARC.h"
61+
#include "llvm/Transforms/OmpSs.h"
6162
#include "llvm/Transforms/Scalar.h"
6263
#include "llvm/Transforms/Scalar/GVN.h"
6364
#include "llvm/Transforms/Utils.h"
@@ -165,6 +166,10 @@ class PassManagerBuilderWrapper : public PassManagerBuilder {
165166
};
166167
}
167168

169+
static void addOmpSsPass(const PassManagerBuilder &Builder, PassManagerBase &PM) {
170+
PM.add(createOmpSsPass());
171+
}
172+
168173
static void addObjCARCAPElimPass(const PassManagerBuilder &Builder, PassManagerBase &PM) {
169174
if (Builder.OptLevel > 0)
170175
PM.add(createObjCARCAPElimPass());
@@ -564,6 +569,11 @@ void EmitAssemblyHelper::CreatePasses(legacy::PassManager &MPM,
564569
if (TM)
565570
TM->adjustPassManager(PMBuilder);
566571

572+
if (LangOpts.OmpSs) {
573+
PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
574+
addOmpSsPass);
575+
}
576+
567577
if (CodeGenOpts.DebugInfoForProfiling ||
568578
!CodeGenOpts.SampleProfileFile.empty())
569579
PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,

clang/tools/driver/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set( LLVM_LINK_COMPONENTS
1111
MCParser
1212
ObjCARCOpts
1313
Option
14+
OmpSs
1415
ScalarOpts
1516
Support
1617
TransformUtils

0 commit comments

Comments
 (0)