[libclc] 6a7b887 - [libclc] Use generic spirv*-unknown-unknown clang triple for SPIR-V targets (#199618)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 3 01:01:05 PDT 2026
Author: Wenju He
Date: 2026-06-03T16:01:00+08:00
New Revision: 6a7b8876153815cf3847d952614440e79e82fc86
URL: https://github.com/llvm/llvm-project/commit/6a7b8876153815cf3847d952614440e79e82fc86
DIFF: https://github.com/llvm/llvm-project/commit/6a7b8876153815cf3847d952614440e79e82fc86.diff
LOG: [libclc] Use generic spirv*-unknown-unknown clang triple for SPIR-V targets (#199618)
spirv-diff shows only numbering change to
spirv64-unknown-unknown/libclc.spv. No change in `llvm-spirv -to-text`
outputs. llvm-diff shows no change on reverse-translated bitcode files.
Also fixes a bug that spirv32-unknown-unknown was incorrectly using
64-bit triple.
Update README.md to use the generic target triple for SPIR-V targets.
Added:
Modified:
libclc/CMakeLists.txt
libclc/README.md
Removed:
################################################################################
diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 44d9f7a281b5d..94ec63c89ff0a 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -123,18 +123,8 @@ foreach( tool IN ITEMS opt llvm-link )
endif()
endforeach()
-# Determine the clang target triple. Vulkan and SPIR-V backend targets use the
-# triple directly; other SPIR-V targets fall back to the legacy SPIR target.
+# Determine the clang target triple.
set(clang_triple ${LIBCLC_TARGET})
-if(LIBCLC_TARGET_ARCH IN_LIST LIBCLC_ARCHS_SPIRV)
- if(NOT LIBCLC_TARGET_OS STREQUAL vulkan AND NOT LIBCLC_USE_SPIRV_BACKEND)
- if(LIBCLC_TARGET_ARCH STREQUAL spirv)
- set(clang_triple spir--)
- else()
- set(clang_triple spir64--)
- endif()
- endif()
-endif()
# Address space values.
set(private_addrspace_val 0)
diff --git a/libclc/README.md b/libclc/README.md
index 169d59b75c5c6..54429d71b3e32 100644
--- a/libclc/README.md
+++ b/libclc/README.md
@@ -60,9 +60,9 @@ cmake ../llvm -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release
#### Configure for SPIR-V targets
```
cmake ../llvm -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release \
- -DRUNTIMES_spirv-mesa-mesa3d_LLVM_ENABLE_RUNTIMES=libclc \
- -DRUNTIMES_spirv64-mesa-mesa3d_LLVM_ENABLE_RUNTIMES=libclc \
- -DLLVM_RUNTIME_TARGETS="spirv-mesa-mesa3d;spirv64-mesa-mesa3d"
+ -DRUNTIMES_spirv32-unknown-unknown_LLVM_ENABLE_RUNTIMES=libclc \
+ -DRUNTIMES_spirv64-unknown-unknown_LLVM_ENABLE_RUNTIMES=libclc \
+ -DLLVM_RUNTIME_TARGETS="spirv32-unknown-unknown;spirv64-unknown-unknown"
```
To build multiple targets, pass them as a semicolon-separated list in
More information about the cfe-commits
mailing list