-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL] Enable nonsemantic.shader.debuginfo.200 by default #16120
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // Generate .o file as SYCL device library file. | ||
| // | ||
| // RUN: touch %t.devicelib.cpp | ||
| // RUN: %clang %t.devicelib.cpp -fsycl -fsycl-targets=spir64-unknown-unknown -c --offload-new-driver -o %t_1.devicelib.o | ||
| // RUN: %clang %t.devicelib.cpp -fsycl -fsycl-targets=spir64_gen-unknown-unknown -c --offload-new-driver -o %t_2.devicelib.o | ||
| // RUN: %clang %t.devicelib.cpp -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown -c --offload-new-driver -o %t_3.devicelib.o | ||
|
|
||
| // Test for default llvm-spirv options | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't found the proper tests for this, so created a new one. The idea of it that when we decide to support new SPIR-V versions etc - we could modify this tests. Similar test is sycl-spirv-ext.c - but it was created for a bit different purpose and I'd like not to modify it with this patch.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test looks to cover the new offloading model with the changes for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added a new test, thanks! |
||
|
|
||
| // RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver \ | ||
| // RUN: -fsycl-targets=spir64-unknown-unknown -c %s -o %t_1.o | ||
| // RUN: clang-linker-wrapper -sycl-device-libraries=%t_1.devicelib.o \ | ||
| // RUN: "--host-triple=x86_64-unknown-linux-gnu" "--linker-path=/usr/bin/ld" \ | ||
| // RUN: "--" "-o" "a.out" %t_1.o --dry-run 2>&1 | FileCheck %s | ||
|
|
||
| // CHECK: llvm-spirv{{.*}}-spirv-debug-info-version=nonsemantic-shader-200 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -830,19 +830,7 @@ getTripleBasedSPIRVTransOpts(const ArgList &Args, | |
| const llvm::Triple Triple) { | ||
| bool IsCPU = Triple.isSPIR() && | ||
| Triple.getSubArch() == llvm::Triple::SPIRSubArch_x86_64; | ||
| // Enable NonSemanticShaderDebugInfo.200 for CPU AOT and for non-Windows | ||
| const bool IsWindowsMSVC = Triple.isWindowsMSVCEnvironment() || | ||
| Args.hasArg(OPT_sycl_is_windows_msvc_env); | ||
| const bool EnableNonSemanticDebug = IsCPU || !IsWindowsMSVC; | ||
| if (EnableNonSemanticDebug) { | ||
| TranslatorArgs.push_back( | ||
| "-spirv-debug-info-version=nonsemantic-shader-200"); | ||
| } else { | ||
| TranslatorArgs.push_back("-spirv-debug-info-version=ocl-100"); | ||
| // Prevent crash in the translator if input IR contains DIExpression | ||
| // operations which don't have mapping to OpenCL.DebugInfo.100 spec. | ||
| TranslatorArgs.push_back("-spirv-allow-extra-diexpressions"); | ||
| } | ||
| TranslatorArgs.push_back("-spirv-debug-info-version=nonsemantic-shader-200"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like in the driver we don't want to do this for FPGA mode, and I don't see that implemented here, and I see at least one check for FPGA in this file: Should we add that here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can add it. Also the current version of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah thats fine for now, i guess lets just make an internal tracker to decide what we're doing with fpga
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If/When we turn on new offloading model by default in our SYCL compilation flow, we will not be using it for FPGA modes. So, it is safe to not add FPGA related logic in ClangLinkerWrapper. Thanks
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. imo we should remove that one place that checks for fpga, but definitely not related to this pr
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @sarnex. There are some unnecessary FPGA related logic which has snuck into the wrapper. That needs to be cleaned up. In my todo list. :-)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thx! |
||
| std::string UnknownIntrinsics("-spirv-allow-unknown-intrinsics=llvm.genx."); | ||
| if (IsCPU) | ||
| UnknownIntrinsics += ",llvm.fpbuiltin"; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.