-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Fix debug info generation when integration footer is present #6774
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
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
aa090b2
[SYCL] Fix debug info generation when integration footer is present
zahiraam e595273
Fix LIT test modules-context-hash-ignore-macros.c.
zahiraam 8ab8763
Fix setting BP on windows.
zahiraam 4506b33
Moved checksum.cpp to Inputs folder.
zahiraam cfc331d
Respond to review comment.
zahiraam 316f47c
Respond to review comments.
zahiraam 85f22a6
Enable the option -full-main-filename for the sycl path only.
zahiraam 2cc31bb
Remove redundant IsSYCL condition.
zahiraam 42e9b68
Removing the IsSYCL part of the condition leads to 2 fails:
zahiraam 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,4 @@ | ||
int main() { | ||
int x = 0; | ||
return x + 1; | ||
} |
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,9 @@ | ||
#include "Inputs/sycl.hpp" | ||
|
||
int main() { | ||
sycl::sampler Sampler; | ||
sycl::kernel_single_task<class use_kernel_for_test>([=]() { | ||
Sampler.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,29 @@ | ||
// This file attempts to emulate content of a file, which is passed to host | ||
// compiler when integration footer is used: this file is considered to be a | ||
// main file and Inputs/debug-info-checksum.cpp serves as integration footer. | ||
// | ||
// The file is specifically named debug-info-checksum-temp-name.cpp to emulate | ||
// the temporary file name, which is generated by the compiler driver for the | ||
// host .cpp file after appending footer to it. | ||
// | ||
// The command line executed is based on what is actually invoked by the | ||
// compiler driver and we explicitly pass 'Inputs/debug-info-checksum.cpp' as | ||
// a main file name to ensure that we can instruct the compiler to emit the | ||
// correct debug info (paths and checksums), even though the input file is not | ||
// exactly what user specified on the command line. | ||
// | ||
// RUN: %clang_cc1 -fsycl-is-host -I %S %S/Inputs/debug-info-checksum.cpp \ | ||
// RUN: -triple x86_64-unknown-linux-gpu \ | ||
// RUN: -main-file-name "%S/Inputs/debug-info-checksum.cpp" \ | ||
// RUN: -full-main-file-name "%S/Inputs/debug-info-checksum.cpp" \ | ||
// RUN: -fsycl-use-main-file-name -dwarf-version=5 -S -emit-llvm \ | ||
// RUN: -O0 -debug-info-kind=constructor -o - | FileCheck %s | ||
// | ||
// Verify that DICompileUnit points to a correct file and that checksum is also | ||
// correct. | ||
// | ||
// CHECK: !DICompileUnit({{.*}} file: ![[#FILE:]] | ||
// CHECK: ![[#FILE]] = !DIFile(filename: "{{.*}}clang{{.+}}test{{.+}}CodeGenSYCL{{.+}}Inputs{{.+}}debug-info-checksum.cpp" | ||
// CHECK-SAME: checksumkind: CSK_MD5, checksum: "f1fb5d68350b47d90a53968ac8c40529" | ||
|
||
#include "Inputs/debug-info-checksum.cpp" |
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,33 @@ | ||
// This test checks that a checksum is created correctly for the compiled file, | ||
// and that the same checksum is generated for host and target compilation. | ||
// It also checks that DICompileUnit in host and target compilation is referring | ||
// to the original source file name (not the temporary file created by the | ||
// compilation process) . | ||
|
||
// RUN: %clang_cc1 -triple spir64-unknown-unknown -fsycl-is-device \ | ||
zahiraam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// RUN: -fsycl-int-header=%t.header.h -fsycl-int-footer=%t.footer.h \ | ||
// RUN: -main-file-name %S/Inputs/checksum.cpp -fsycl-use-main-file-name \ | ||
// RUN: -full-main-file-name "%S/Inputs/checksum.cpp" \ | ||
// RUN: -gcodeview -debug-info-kind=limited -emit-llvm -O0 -o - "%S/Inputs/checksum.cpp" \ | ||
// RUN: | FileCheck %s -check-prefix=COMP1 | ||
|
||
// RUN: append-file "%S/Inputs/checksum.cpp" \ | ||
// RUN: --append=%t.footer.h \ | ||
// RUN: --orig-filename="%S/Inputs/checksum.cpp" \ | ||
// RUN: --output=%t.checksum.cpp --use-include | ||
|
||
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsycl-is-host \ | ||
// RUN: -include %t.header.h -dependency-filter %t.header.h \ | ||
// RUN: -main-file-name %S/Inputs/checksum.cpp -fsycl-use-main-file-name \ | ||
// RUN: -full-main-file-name %S/Inputs/checksum.cpp \ | ||
// RUN: -gcodeview -debug-info-kind=limited -emit-llvm -O0 -o - \ | ||
// RUN: %t.checksum.cpp \ | ||
// RUN: | FileCheck %s -check-prefix=COMP2 | ||
|
||
// COMP1: !DICompileUnit({{.*}} file: ![[#FILE1:]] | ||
// COMP1: ![[#FILE1]] = !DIFile(filename: "{{.*}}clang{{.+}}test{{.+}}CodeGenSYCL{{.+}}checksum.cpp" | ||
// COMP1-SAME: checksumkind: CSK_MD5, checksum: "259269f735d83ec32c46a11352458493") | ||
|
||
// COMP2: !DICompileUnit({{.*}} file: ![[#FILE2:]] | ||
// COMP2: ![[#FILE2]] = !DIFile(filename: "{{.*}}clang{{.+}}test{{.+}}CodeGenSYCL{{.+}}checksum.cpp" | ||
// COMP2-SAME: checksumkind: CSK_MD5, checksum: "259269f735d83ec32c46a11352458493") |
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
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.