Skip to content
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

[SYCL] Enable nonsemantic.shader.debuginfo.200 by default #16120

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

MrSidims
Copy link
Contributor

@MrSidims MrSidims commented Nov 19, 2024

It's left disabled only for FPGA target.

It's left disenabled only for FPGA target.

Signed-off-by: Sidorov, Dmitry <[email protected]>
// 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
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The 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 clang-linker-wrapper. Should an equivalent test be created for the old offloading model behaviors to check the driver defaults?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a new test, thanks!

Signed-off-by: Sidorov, Dmitry <[email protected]>
// 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");
Copy link
Contributor

Choose a reason for hiding this comment

The 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:

Triple.getSubArch() != llvm::Triple::SPIRSubArch_fpga

Should we add that here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add it. Also the current version of getTripleBasedSPIRVTransOpts in ClangLinkerWrapper.cpp doesn't consider FPGA, while the logic must be exactly like in https://github.com/intel/llvm/blob/sycl/clang/lib/Driver/ToolChains/Clang.cpp#L10728 . This should go into a separate patch.

Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Contributor

@sarnex sarnex Nov 19, 2024

Choose a reason for hiding this comment

The 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

Copy link
Contributor

Choose a reason for hiding this comment

The 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. :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx!

clang/lib/Driver/ToolChains/Clang.cpp Show resolved Hide resolved
Copy link
Contributor

@asudarsa asudarsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks

Copy link
Contributor

@mdtoguchi mdtoguchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MrSidims MrSidims requested a review from a team November 19, 2024 18:08
@sarnex sarnex merged commit 8922ee7 into intel:sycl Nov 19, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants