Skip to content

Commit 457b1ec

Browse files
committed
SYCLITT -> SPIRITT
Signed-off-by: Dmitry Sidorov <dmitry.sidorov@intel.com>
1 parent 6ab9c02 commit 457b1ec

File tree

15 files changed

+46
-41
lines changed

15 files changed

+46
-41
lines changed

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,8 @@ SYCLLowerIR/ @kbobrovs @DenisBakhvalov
114114
esimd/ @kbobrovs @DenisBakhvalov
115115
sycl/include/CL/sycl/INTEL/esimd.hpp @kbobrovs @DenisBakhvalov
116116
sycl/doc/extensions/ExplicitSIMD/ @kbobrovs
117+
118+
# ITT annotations
119+
llvm/lib/Transforms/Instrumentation/SPIRITTAnnotations.cpp @MrSidims
120+
llvm/include/llvm/Transforms/Instrumentation/SPIRITTAnnotations.h @MrSidims
121+

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ CODEGENOPT(PassByValueIsNoAlias, 1, 0)
417417
/// according to the field declaring type width.
418418
CODEGENOPT(AAPCSBitfieldWidth, 1, 1)
419419

420-
// Whether to instrument SYCL device code with ITT annotations
421-
CODEGENOPT(SYCLITTAnnotations, 1, 0)
420+
// Whether to instrument SPIR device code with ITT annotations
421+
CODEGENOPT(SPIRITTAnnotations, 1, 0)
422422

423423
#undef CODEGENOPT
424424
#undef ENUM_CODEGENOPT

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2421,7 +2421,7 @@ def fno_sycl_device_code_lower_esimd : Flag<["-"], "fno-sycl-device-code-lower-e
24212421
def fsycl_instrument_device_code : Flag<["-"], "fsycl-instrument-device-code">,
24222422
Group<f_Group>, Flags<[CC1Option, CoreOption]>,
24232423
HelpText<"Add ITT instrumentation intrinsics calls">,
2424-
MarshallingInfoFlag<CodeGenOpts<"SYCLITTAnnotations">>;
2424+
MarshallingInfoFlag<CodeGenOpts<"SPIRITTAnnotations">>;
24252425
defm sycl_id_queries_fit_in_int: OptInFFlag<"sycl-id-queries-fit-in-int", "Assume", "Do not assume", " that SYCL ID queries fit within MAX_INT.", [CC1Option,CoreOption], LangOpts<"SYCLValueFitInMaxInt">>;
24262426
def fsycl_use_bitcode : Flag<["-"], "fsycl-use-bitcode">,
24272427
Flags<[CC1Option, CoreOption]>, HelpText<"Use LLVM bitcode instead of SPIR-V in fat objects">;

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
#include "llvm/Transforms/Instrumentation/InstrProfiling.h"
7373
#include "llvm/Transforms/Instrumentation/MemProfiler.h"
7474
#include "llvm/Transforms/Instrumentation/MemorySanitizer.h"
75-
#include "llvm/Transforms/Instrumentation/SYCLITTAnnotations.h"
75+
#include "llvm/Transforms/Instrumentation/SPIRITTAnnotations.h"
7676
#include "llvm/Transforms/Instrumentation/SanitizerCoverage.h"
7777
#include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
7878
#include "llvm/Transforms/ObjCARC.h"
@@ -949,14 +949,14 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action,
949949
LangOpts.EnableDAEInSpirKernels)
950950
PerModulePasses.add(createDeadArgEliminationSYCLPass());
951951

952-
// Add SYCLITTAnnotations pass to the pass manager if
952+
// Add SPIRITTAnnotations pass to the pass manager if
953953
// -fsycl-instrument-device-code option was passed. This option can be
954954
// used only with spir tripple.
955-
if (CodeGenOpts.SYCLITTAnnotations) {
955+
if (CodeGenOpts.SPIRITTAnnotations) {
956956
if (!llvm::Triple(TheModule->getTargetTriple()).isSPIR())
957957
llvm::report_fatal_error(
958958
"ITT annotations can only by added to a module with spir target");
959-
PerModulePasses.add(createSYCLITTAnnotationsPass());
959+
PerModulePasses.add(createSPIRITTAnnotationsPass());
960960
}
961961

962962
switch (Action) {

clang/test/Driver/sycl-instrumentation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// Check that SYCL ITT instrumentation is disabled by default:
1+
/// Check that SPIR ITT instrumentation is disabled by default:
22
// RUN: %clang -### %s 2>&1 \
33
// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s
44
// CHECK-DEFAULT-NOT: "-fsycl-instrument-device-code"

llvm/include/llvm/InitializePasses.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ void initializeStripSymbolsPass(PassRegistry&);
429429
void initializeStructurizeCFGLegacyPassPass(PassRegistry &);
430430
void initializeSYCLLowerWGScopeLegacyPassPass(PassRegistry &);
431431
void initializeSYCLLowerESIMDLegacyPassPass(PassRegistry &);
432-
void initializeSYCLITTAnnotationsLegacyPassPass(PassRegistry &);
432+
void initializeSPIRITTAnnotationsLegacyPassPass(PassRegistry &);
433433
void initializeESIMDLowerLoadStorePass(PassRegistry &);
434434
void initializeESIMDLowerVecArgLegacyPassPass(PassRegistry &);
435435
void initializeTailCallElimPass(PassRegistry&);

llvm/include/llvm/LinkAllPasses.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#include "llvm/Transforms/InstCombine/InstCombine.h"
4949
#include "llvm/Transforms/Instrumentation.h"
5050
#include "llvm/Transforms/Instrumentation/BoundsChecking.h"
51-
#include "llvm/Transforms/Instrumentation/SYCLITTAnnotations.h"
51+
#include "llvm/Transforms/Instrumentation/SPIRITTAnnotations.h"
5252
#include "llvm/Transforms/ObjCARC.h"
5353
#include "llvm/Transforms/Scalar.h"
5454
#include "llvm/Transforms/Scalar/GVN.h"
@@ -205,7 +205,7 @@ namespace {
205205
(void)llvm::createSYCLLowerESIMDPass();
206206
(void)llvm::createESIMDLowerLoadStorePass();
207207
(void)llvm::createESIMDLowerVecArgPass();
208-
(void)llvm::createSYCLITTAnnotationsPass();
208+
(void)llvm::createSPIRITTAnnotationsPass();
209209
std::string buf;
210210
llvm::raw_string_ostream os(buf);
211211
(void) llvm::createPrintModulePass(os);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===----- SYCLITTAnnotations.h - SYCL Instrumental Annotations Pass ------===//
1+
//===----- SPIRITTAnnotations.h - SYCL Instrumental Annotations Pass ------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -7,7 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
//
99
// A transformation pass which adds instrumental calls to annotate SYCL
10-
// synchronization instrucations. This can be used for kernel profiling.
10+
// synchronization instructions. This can be used for kernel profiling.
1111
//===----------------------------------------------------------------------===//
1212

1313
#pragma once
@@ -17,11 +17,11 @@
1717

1818
namespace llvm {
1919

20-
class SYCLITTAnnotationsPass : public PassInfoMixin<SYCLITTAnnotationsPass> {
20+
class SPIRITTAnnotationsPass : public PassInfoMixin<SPIRITTAnnotationsPass> {
2121
public:
2222
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
2323
};
2424

25-
ModulePass *createSYCLITTAnnotationsPass();
25+
ModulePass *createSPIRITTAnnotationsPass();
2626

2727
} // namespace llvm

llvm/lib/Transforms/Instrumentation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ add_llvm_component_library(LLVMInstrumentation
1515
PGOMemOPSizeOpt.cpp
1616
PoisonChecking.cpp
1717
SanitizerCoverage.cpp
18-
SYCLITTAnnotations.cpp
18+
SPIRITTAnnotations.cpp
1919
ValueProfileCollector.cpp
2020
ThreadSanitizer.cpp
2121
HWAddressSanitizer.cpp

llvm/lib/Transforms/Instrumentation/SYCLITTAnnotations.cpp renamed to llvm/lib/Transforms/Instrumentation/SPIRITTAnnotations.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===---- SYCLITTAnnotations.cpp - SYCL Instrumental Annotations Pass -----===//
1+
//===---- SPIRITTAnnotations.cpp - SYCL Instrumental Annotations Pass -----===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,7 +10,7 @@
1010
// synchronization instructions. This can be used for kernel profiling.
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "llvm/Transforms/Instrumentation/SYCLITTAnnotations.h"
13+
#include "llvm/Transforms/Instrumentation/SPIRITTAnnotations.h"
1414

1515
#include "llvm/IR/Function.h"
1616
#include "llvm/IR/InstIterator.h"
@@ -19,7 +19,7 @@
1919
#include "llvm/IR/Type.h"
2020
#include "llvm/InitializePasses.h"
2121

22-
/** Following instrumentations will be linked from libdevice:
22+
/** Following functions are used for ITT instrumentation:
2323
* * * * * * * * * * *
2424
* Notify tools work-item execution has started
2525
*
@@ -106,41 +106,41 @@ constexpr char ITT_ANNOTATION_ATOMIC_FINISH[] =
106106
"__itt_offload_atomic_op_finish";
107107

108108
// Wrapper for the pass to make it working with the old pass manager
109-
class SYCLITTAnnotationsLegacyPass : public ModulePass {
109+
class SPIRITTAnnotationsLegacyPass : public ModulePass {
110110
public:
111111
static char ID;
112-
SYCLITTAnnotationsLegacyPass() : ModulePass(ID) {
113-
initializeSYCLITTAnnotationsLegacyPassPass(
112+
SPIRITTAnnotationsLegacyPass() : ModulePass(ID) {
113+
initializeSPIRITTAnnotationsLegacyPassPass(
114114
*PassRegistry::getPassRegistry());
115115
}
116116

117-
// run the SYCLITTAnnotations pass on the specified module
117+
// run the SPIRITTAnnotations pass on the specified module
118118
bool runOnModule(Module &M) override {
119119
ModuleAnalysisManager MAM;
120120
auto PA = Impl.run(M, MAM);
121121
return !PA.areAllPreserved();
122122
}
123123

124124
private:
125-
SYCLITTAnnotationsPass Impl;
125+
SPIRITTAnnotationsPass Impl;
126126
};
127127

128128
} // namespace
129129

130-
char SYCLITTAnnotationsLegacyPass::ID = 0;
131-
INITIALIZE_PASS(SYCLITTAnnotationsLegacyPass, "SYCLITTAnnotations",
130+
char SPIRITTAnnotationsLegacyPass::ID = 0;
131+
INITIALIZE_PASS(SPIRITTAnnotationsLegacyPass, "SPIRITTAnnotations",
132132
"Insert ITT annotations in SYCL code", false, false)
133133

134-
// Public interface to the SYCLITTAnnotationsPass.
135-
ModulePass *llvm::createSYCLITTAnnotationsPass() {
136-
return new SYCLITTAnnotationsLegacyPass();
134+
// Public interface to the SPIRITTAnnotationsPass.
135+
ModulePass *llvm::createSPIRITTAnnotationsPass() {
136+
return new SPIRITTAnnotationsLegacyPass();
137137
}
138138

139139
namespace {
140140

141141
// Check for calling convention of a function. If it's spir_kernel - consider
142142
// the function to be a SYCL kernel.
143-
bool isSyclKernel(Function &F) {
143+
bool isSPIRKernel(Function &F) {
144144
return F.getCallingConv() == CallingConv::SPIR_KERNEL;
145145
}
146146

@@ -231,7 +231,7 @@ bool insertAtomicInstrumentationCall(Module &M, StringRef Name,
231231

232232
} // namespace
233233

234-
PreservedAnalyses SYCLITTAnnotationsPass::run(Module &M,
234+
PreservedAnalyses SPIRITTAnnotationsPass::run(Module &M,
235235
ModuleAnalysisManager &MAM) {
236236
bool IRModified = false;
237237
std::vector<StringRef> SPIRVCrossWGInstuctions = {
@@ -242,7 +242,7 @@ PreservedAnalyses SYCLITTAnnotationsPass::run(Module &M,
242242

243243
for (Function &F : M) {
244244
// Annotate only SYCL kernels
245-
if (F.isDeclaration() || !isSyclKernel(F))
245+
if (F.isDeclaration() || !isSPIRKernel(F))
246246
continue;
247247

248248
// At the beggining of a kernel insert work item start annotation

llvm/test/Transforms/SYCLITTAnnotations/itt_atomic_load.ll renamed to llvm/test/Transforms/SPIRITTAnnotations/itt_atomic_load.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
;; The test serves a purpose to check if Atomic load instruction is being
2-
;; annotated by SYCLITTAnnotations pass
2+
;; annotated by SPIRITTAnnotations pass
33
;;
44
;; Compiled from https://github.com/intel/llvm-test-suite/blob/intel/SYCL/AtomicRef/load.cpp
55
;; with following commands:
66
;; clang++ -fsycl -fsycl-device-only load.cpp -o load.bc
77

8-
; RUN: opt < %s --SYCLITTAnnotations -S | FileCheck %s
8+
; RUN: opt < %s --SPIRITTAnnotations -S | FileCheck %s
99

1010
; ModuleID = 'load.bc'
1111
source_filename = "llvm-test-suite/SYCL/AtomicRef/load.cpp"

llvm/test/Transforms/SYCLITTAnnotations/itt_atomic_store.ll renamed to llvm/test/Transforms/SPIRITTAnnotations/itt_atomic_store.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
;; The test serves a purpose to check if Atomic store instruction is being
2-
;; annotated by SYCLITTAnnotations pass
2+
;; annotated by SPIRITTAnnotations pass
33
;;
44
;; Compiled from https://github.com/intel/llvm-test-suite/blob/intel/SYCL/AtomicRef/load.cpp
55
;; with following commands:
66
;; clang++ -fsycl -fsycl-device-only load.cpp -o load.bc
77

8-
; RUN: opt < %s --SYCLITTAnnotations -S | FileCheck %s
8+
; RUN: opt < %s --SPIRITTAnnotations -S | FileCheck %s
99

1010
; ModuleID = 'store.bc'
1111
source_filename = "llvm-test-suite/SYCL/AtomicRef/store.cpp"

llvm/test/Transforms/SYCLITTAnnotations/itt_barrier.ll renamed to llvm/test/Transforms/SPIRITTAnnotations/itt_barrier.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
;; The test serves a purpose to check if barrier instruction is being annotated
2-
;; by SYCLITTAnnotations pass
2+
;; by SPIRITTAnnotations pass
33
;;
44
;; Compiled from https://github.com/intel/llvm-test-suite/blob/intel/SYCL/KernelAndProgram/kernel-and-program.cpp
55
;; with following commands:
66
;; clang++ -fsycl -fsycl-device-only kernel-and-program.cpp -o kernel_and_program_optimized.bc
77

8-
; RUN: opt < %s --SYCLITTAnnotations -S | FileCheck %s
8+
; RUN: opt < %s --SPIRITTAnnotations -S | FileCheck %s
99

1010
; ModuleID = 'kernel_and_program_optimized.bc'
1111
source_filename = "llvm-link"

llvm/test/Transforms/SYCLITTAnnotations/itt_start_finish.ll renamed to llvm/test/Transforms/SPIRITTAnnotations/itt_start_finish.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
;; The test serves a purpose to check if work item start/finish annotations
2-
;; are being added by SYCLITTAnnotations pass
2+
;; are being added by SPIRITTAnnotations pass
33

4-
; RUN: opt < %s --SYCLITTAnnotations -S | FileCheck %s
4+
; RUN: opt < %s --SPIRITTAnnotations -S | FileCheck %s
55

66
; ModuleID = 'synthetic.bc'
77
source_filename = "synthetic.cpp"

llvm/tools/opt/opt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ int main(int argc, char **argv) {
582582
initializeReplaceWithVeclibLegacyPass(Registry);
583583
initializeSYCLLowerWGScopeLegacyPassPass(Registry);
584584
initializeSYCLLowerESIMDLegacyPassPass(Registry);
585-
initializeSYCLITTAnnotationsLegacyPassPass(Registry);
585+
initializeSPIRITTAnnotationsLegacyPassPass(Registry);
586586
initializeESIMDLowerLoadStorePass(Registry);
587587
initializeESIMDLowerVecArgLegacyPassPass(Registry);
588588

0 commit comments

Comments
 (0)