Skip to content

Commit 97a61a7

Browse files
authored
[SYCL][ESIMD][NewPM] Add ESIMDVerifierPass to new PM pipeline in CodeGen (#5298)
Signed-off-by: Mikhail Lychkov <[email protected]>
1 parent 8b29220 commit 97a61a7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,12 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
13841384
// configure the pipeline.
13851385
OptimizationLevel Level = mapToLevel(CodeGenOpts);
13861386

1387+
if (LangOpts.SYCLIsDevice)
1388+
PB.registerPipelineStartEPCallback(
1389+
[](ModulePassManager &MPM, OptimizationLevel Level) {
1390+
MPM.addPass(ESIMDVerifierPass());
1391+
});
1392+
13871393
bool IsThinLTO = CodeGenOpts.PrepareForThinLTO;
13881394
bool IsLTO = CodeGenOpts.PrepareForLTO;
13891395

sycl/test/esimd/esimd_verify.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
// RUN: not %clangxx -fsycl -fsycl-device-only -S %s -o %t 2>&1 | FileCheck %s
1+
// RUN: not %clangxx -fsycl -fsycl-device-only -flegacy-pass-manager -S %s -o /dev/null 2>&1 | FileCheck %s
2+
// RUN: not %clangxx -fsycl -fsycl-device-only -fno-legacy-pass-manager -S %s -o /dev/null 2>&1 | FileCheck %s
3+
// RUN: not %clangxx -fsycl -fsycl-device-only -flegacy-pass-manager -O0 -S %s -o /dev/null 2>&1 | FileCheck %s
4+
// RUN: not %clangxx -fsycl -fsycl-device-only -fno-legacy-pass-manager -O0 -S %s -o /dev/null 2>&1 | FileCheck %s
25

36
#include <sycl/ext/intel/experimental/esimd.hpp>
47

0 commit comments

Comments
 (0)