Skip to content

Conversation

@wenju-he
Copy link
Contributor

@wenju-he wenju-he commented Nov 20, 2025

Restore pulldown omissions:

  • Restore output layout from df74736: build/lib/clc -> build/lib/clang/<LLVM_VERSION>/lib/libclc
  • Restore standalone build LIBCLC_INSTALL_DIR from b9e2f7a.

Additional changes:

  • Remove repeated directory creation for LIBCLC_OUTPUT_LIBRARY_DIR.
  • Install libspirv remangled-* bitcodes into LIBCLC_INSTALL_DIR.
  • SYCLInstallationDetector findLibspirvPath is now simplifed.
  • Updated libspirv path in sycl-jit/jit-compiler.

…e dir

Restore pulldown omissions:
* Restore output layout from df74736:
  build/lib/clc -> build/lib/clang/<LLVM_VERSION>/lib/libclc
* Restore standalone build LIBCLC_INSTALL_DIR from b9e2f7a.

Additional changes:
* Remove repeated directory creation for LIBCLC_OUTPUT_LIBRARY_DIR.
* Install libspirv remangled-* bitcodes into LIBCLC_INSTALL_DIR.
* SYCLInstallationDetector findLibspirvPath is now simplifed.
Copy link
Contributor

@Maetveis Maetveis left a comment

Choose a reason for hiding this comment

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

Driver and driver test changes LGTM with some nits. I haven't checked CMake changes, that's mostly coming from upstream right?

// RUN: | FileCheck %s --check-prefixes=CHECK-DEVICE-ONLY
// CHECK-DEVICE-ONLY: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "{{.*[\\/]}}remangled-{{.*}}.libspirv-nvptx64-nvidia-cuda.bc"
// RUN: %clang -### -resource-dir %{resource_dir} -fsycl -fsycl-targets=nvptx64-nvidia-cuda -nocudalib -target x86_64-unknown-windows-msvc %s 2>&1 \
// RUN: | FileCheck %s -DRESOURCE_DIR=%{resource_dir} --check-prefixes=CHECK-WINDOWS
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep the FileCheck and CHECK lines here the same as they were. These checks are to verify the base name of the library, it's better to keep them independent of the absolute path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Keep the FileCheck and CHECK lines here the same as they were. These checks are to verify the base name of the library, it's better to keep them independent of the absolute path.

done in 4f560f8

Copy link
Contributor

Choose a reason for hiding this comment

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

My comment applies to all checks in that block, I marked all of them now.

Co-authored-by: Mészáros Gergely <maetveis@gmail.com>
@wenju-he
Copy link
Contributor Author

wenju-he commented Nov 25, 2025

I haven't checked CMake changes, that's mostly coming from upstream right?

Yes, except for db7fc8a and change to remangled libspirv install.

// RUN: | FileCheck %s --check-prefixes=CHECK-LINUX
// CHECK-LINUX: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "{{.*[\\/]}}remangled-l64-signed_char.libspirv-nvptx64-nvidia-cuda.bc"
// RUN: %clang -### -resource-dir %{resource_dir} -fsycl -fsycl-targets=nvptx64-nvidia-cuda -nocudalib -target x86_64-unknown-linux-gnu %s 2>&1 \
// RUN: | FileCheck %s -DRESOURCE_DIR=%{resource_dir} --check-prefixes=CHECK-LINUX
Copy link
Contributor

Choose a reason for hiding this comment

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

here too the same as in #20701 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here too the same as in #20701 (comment)

done

// RUN: %clang -### -resource-dir %{resource_dir} -fsycl -fsycl-targets=nvptx64-nvidia-cuda -nocudalib -target x86_64-unknown-linux-gnu %s 2>&1 \
// RUN: | FileCheck %s -DRESOURCE_DIR=%{resource_dir} --check-prefixes=CHECK-LINUX
// RUN: %clang -### -resource-dir %{resource_dir} -fsycl -fsycl-targets=nvptx64-nvidia-cuda -nocudalib -target x86_64-unknown-windows-cygnus %s 2>&1 \
// RUN: | FileCheck %s -DRESOURCE_DIR=%{resource_dir} --check-prefixes=CHECK-LINUX
Copy link
Contributor

Choose a reason for hiding this comment

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

here too the same as in #20701 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here too the same as in #20701 (comment)

done

// RUN: | FileCheck %s --check-prefixes=CHECK-AMDGCN-WINDOWS
// CHECK-AMDGCN-WINDOWS: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "{{.*[\\/]}}remangled-l32-signed_char.libspirv-amdgcn-amd-amdhsa.bc"
// RUN: %clang -### -resource-dir %{resource_dir} -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx908 -nogpulib -target x86_64-unknown-windows-msvc %s 2>&1 \
// RUN: | FileCheck %s -DRESOURCE_DIR=%{resource_dir} --check-prefixes=CHECK-AMDGCN-WINDOWS
Copy link
Contributor

Choose a reason for hiding this comment

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

here too the same as in #20701 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here too the same as in #20701 (comment)

done

// RUN: | FileCheck %s --check-prefixes=CHECK-DEVICE-ONLY
// CHECK-DEVICE-ONLY: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "{{.*[\\/]}}remangled-{{.*}}.libspirv-nvptx64-nvidia-cuda.bc"
// RUN: %clang -### -resource-dir %{resource_dir} -fsycl -fsycl-device-only -fsycl-targets=nvptx64-nvidia-cuda -nocudalib %s 2>&1 \
// RUN: | FileCheck %s -DRESOURCE_DIR=%{resource_dir} --check-prefixes=CHECK-DEVICE-ONLY
Copy link
Contributor

Choose a reason for hiding this comment

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

here too the same as in #20701 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here too the same as in #20701 (comment)

done

Comment on lines 835 to 836
Driver D{(SYCLToolchain::instance().getPrefix() + "/bin/clang++").str(),
T.getTriple(), Diags};
Copy link
Contributor

Choose a reason for hiding this comment

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

There is getClangXXExe:

std::string_view getPrefix() const { return Prefix; }
std::string_view getClangXXExe() const { return ClangXXExe; }

I understand this is a move, but we can update it still.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is getClangXXExe:

std::string_view getPrefix() const { return Prefix; }
std::string_view getClangXXExe() const { return ClangXXExe; }

I understand this is a move, but we can update it still.

done, updated to use getClangXXExe

(SYCLToolchain::instance().getPrefix() + "/lib/" + LibName).str();
std::string LibPath;
if (LibName.find("libspirv") != std::string::npos) {
SmallString<256> LibraryPath(D.ResourceDir);
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, resource dir getter should go to the SYCLToolchain class, maybe it should be even pre-computed and stored as a data member.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO, resource dir getter should go to the SYCLToolchain class, maybe it should be even pre-computed and stored as a data member.

done, moved to a data member of SYCLToolchain

std::string LibPath;
if (LibName.find("libspirv") != std::string::npos) {
SmallString<256> LibraryPath(D.ResourceDir);
sys::path::append(LibraryPath, "lib", "libclc", LibName);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we use sys::path::append in this file (probably erroneously), but can we use simple string concatenation for uniformity?

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 don't think we use sys::path::append in this file (probably erroneously), but can we use simple string concatenation for uniformity?

done

Copy link
Contributor

@aelovikov-intel aelovikov-intel left a comment

Choose a reason for hiding this comment

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

sycl-jit LGTM, thanks!

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