Skip to content

Commit ff1ffd0

Browse files
committed
[SYCL][ESIMD][NewPM] Add ESIMDVerifierPass to new PM pipeline in CodeGen
Signed-off-by: Mikhail Lychkov <[email protected]>
1 parent c18f43c commit ff1ffd0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

clang/lib/CodeGen/BackendUtil.cpp

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

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

sycl/test/esimd/esimd_verify.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
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
23

34
#include <sycl/ext/intel/experimental/esimd.hpp>
45

0 commit comments

Comments
 (0)