[clang] [libclc] [libclc] Rework libclc naming convention to use the triple (PR #177465)

Wenju He via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 22 21:16:21 PST 2026


================
@@ -419,8 +393,7 @@ function(add_libclc_builtin_set)
     endif()
   else()
     # Non-SPIR-V targets add an extra step to optimize the bytecode
-    set( obj_suffix ${ARG_ARCH_SUFFIX}.bc )
-    set( libclc_builtins_lib ${LIBCLC_OUTPUT_LIBRARY_DIR}/${obj_suffix} )
+    set( libclc_builtins_lib ${LIBCLC_OUTPUT_LIBRARY_DIR}/${ARG_TRIPLE}/${LIBCLC_OUTPUT_FILENAME}.bc )
----------------
wenju-he wrote:

there are multiple libclc.bc files for one triple, e.g. r600-- triple has 4 bitcode files, see https://github.com/llvm/llvm-project/blob/c961174b2d557c04b32fbe104ca32f5294345864/libclc/CMakeLists.txt#L209
You can use following command to test:
cmake -GNinja -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;libclc;lld" -DLLVM_INCLUDE_TESTS=ON -DLLVM_BUILD_TESTS=ON -DLLVM_ENABLE_ASSERTIONS=ON ../llvm -DLLVM_TARGETS_TO_BUILD="X86;SPIRV;NVPTX;AMDGPU" -DCMAKE_BUILD_TYPE=Release -DLIBCLC_TARGETS_TO_BUILD="all"

https://github.com/llvm/llvm-project/pull/177465


More information about the cfe-commits mailing list