-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Add ITT annotation instructions #3299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bader
merged 17 commits into
intel:sycl
from
MrSidims:private/MrSidims/InstrumentalAnnotations
Mar 16, 2021
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
01daa5a
[SYCL] Add ITT annotation instructions
MrSidims 573670b
Test fix
MrSidims 0f17bac
Comments fixes
MrSidims 4d01c8b
Apply several comments
MrSidims d583984
Move the pass from sycl-post-link to FE
MrSidims 1014db0
Rename
MrSidims e1d768a
Change driver part
MrSidims 825f58a
Few bug fixes
MrSidims c0809fe
Small fixes
MrSidims f165273
Merge remote-tracking branch 'origin/sycl' into private/MrSidims/Inst…
MrSidims 8bb5cdf
Several fixes
MrSidims 33e6101
Add diag + clang format
MrSidims d525d3c
Fix test
MrSidims 6ab9c02
Update pass header
MrSidims 457b1ec
SYCLITT -> SPIRITT
MrSidims e1aa264
Apply suggestions
MrSidims a41f48a
Apply driver suggestions
MrSidims File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/// Check if start/finish ITT annotations are being added during compilation of | ||
/// SYCL device code | ||
|
||
// RUN: %clang_cc1 -fsycl-is-device -fsycl-instrument-device-code -triple spir64-unknown-unknown-sycldevice -emit-llvm %s -o - | FileCheck %s | ||
|
||
// CHECK: kernel_function | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: call void @__itt_offload_wi_start_wrapper() | ||
// CHECK: call void @__itt_offload_wi_finish_wrapper() | ||
// CHECK-NEXT: ret void | ||
|
||
#include "Inputs/sycl.hpp" | ||
|
||
int main() { | ||
cl::sycl::accessor<int, 1, cl::sycl::access::mode::read_write> accessorA; | ||
cl::sycl::kernel_single_task<class kernel_function>( | ||
[=]() { | ||
accessorA.use(); | ||
}); | ||
return 0; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/// Check that SPIR ITT instrumentation is disabled by default: | ||
// RUN: %clang -### %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s | ||
// CHECK-DEFAULT-NOT: "-fsycl-instrument-device-code" | ||
|
||
/// Check if "fsycl_instrument_device_code" is passed to -cc1: | ||
// RUN: %clang -### -fsycl-instrument-device-code %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=CHECK-ENABLED %s | ||
// CHECK-ENABLED: "-cc1"{{.*}} "-fsycl-instrument-device-code" | ||
|
||
/// Check if "fsycl_instrument_device_code" usage with a non-spirv target | ||
/// results in an error. | ||
// RUN: %clang -### -fsycl-instrument-device-code --target=x86 %s 2>&1 | ||
// expected-error{{unsupported option '-fsycl-instrument-device-code' for target 'x86_64-unknown-linux-gnu'}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
llvm/include/llvm/Transforms/Instrumentation/SPIRITTAnnotations.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//===----- SPIRITTAnnotations.h - SPIR Instrumental Annotations Pass ------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// A transformation pass which adds instrumental calls to annotate SPIR | ||
// synchronization instructions. This can be used for kernel profiling. | ||
//===----------------------------------------------------------------------===// | ||
|
||
#pragma once | ||
|
||
#include "llvm/IR/Module.h" | ||
#include "llvm/IR/PassManager.h" | ||
|
||
namespace llvm { | ||
|
||
class SPIRITTAnnotationsPass : public PassInfoMixin<SPIRITTAnnotationsPass> { | ||
public: | ||
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM); | ||
}; | ||
|
||
ModulePass *createSPIRITTAnnotationsPass(); | ||
|
||
} // namespace llvm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.