File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1481,6 +1481,16 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
1481
1481
MPM.addPass (SYCLMutatePrintfAddrspacePass ());
1482
1482
}
1483
1483
1484
+ // Add SPIRITTAnnotations pass to the pass manager if
1485
+ // -fsycl-instrument-device-code option was passed. This option can be used
1486
+ // only with spir triple.
1487
+ if (CodeGenOpts.SPIRITTAnnotations ) {
1488
+ if (!llvm::Triple (TheModule->getTargetTriple ()).isSPIR ())
1489
+ llvm::report_fatal_error (
1490
+ " ITT annotations can only by added to a module with spir target" );
1491
+ MPM.addPass (SPIRITTAnnotationsPass ());
1492
+ }
1493
+
1484
1494
// Add a verifier pass if requested. We don't have to do this if the action
1485
1495
// requires code generation because there will already be a verifier pass in
1486
1496
// the code-generation pipeline.
Original file line number Diff line number Diff line change 1
1
// / Check if start/finish ITT annotations are being added during compilation of
2
2
// / SYCL device code
3
3
4
- // RUN: %clang_cc1 -fsycl-is-device -fsycl-instrument-device-code -triple spir64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
4
+ // RUN: %clang_cc1 -fsycl-is-device -flegacy-pass-manager -fsycl-instrument-device-code -triple spir64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
5
+ // RUN: %clang_cc1 -fsycl-is-device -fno-legacy-pass-manager -fsycl-instrument-device-code -triple spir64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
5
6
6
7
// CHECK: kernel_function
7
8
// CHECK-NEXT: entry:
You can’t perform that action at this time.
0 commit comments