================
@@ -121,50 +121,40 @@ if(ARCH STREQUAL amdgcn)
 elseif(ARCH STREQUAL nvptx64)
   add_subdirectory(clc/lib/ptx-nvidiacl)
 elseif(ARCH STREQUAL spirv OR ARCH STREQUAL spirv64)
-  add_subdirectory(clc/lib/spirv)
-  add_subdirectory(opencl/lib/spirv)
-elseif(ARCH STREQUAL clspv OR ARCH STREQUAL clspv64)
-  add_subdirectory(clc/lib/clspv)
-  add_subdirectory(opencl/lib/clspv)
+  if(OS STREQUAL vulkan)
+    add_subdirectory(clc/lib/vulkan)
+    add_subdirectory(opencl/lib/vulkan)
+  else()
+    add_subdirectory(clc/lib/spirv)
+    add_subdirectory(opencl/lib/spirv)
+  endif()
 endif()
 
 add_custom_target( libclc ALL )
 
 add_custom_target( libclc-opencl-builtins COMMENT "Build libclc OpenCL 
builtins" )
 add_dependencies( libclc libclc-opencl-builtins )
 
-# Determine the clang target triple.
+# 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.
 set(clang_triple ${LIBCLC_TARGET})
-if(ARCH STREQUAL spirv AND LIBCLC_USE_SPIRV_BACKEND)
-  set(clang_triple spirv32--)
-elseif(ARCH STREQUAL spirv64 AND LIBCLC_USE_SPIRV_BACKEND)
-  set(clang_triple spirv64--)
-elseif(ARCH STREQUAL spirv OR ARCH STREQUAL clspv)
-  set(clang_triple spir--)
-elseif(ARCH STREQUAL spirv64 OR ARCH STREQUAL clspv64)
-  set(clang_triple spir64--)
-endif()
-
-# Determine the preprocessor identifier for this target.
-set(MACRO_ARCH ${ARCH})
-if(ARCH STREQUAL spirv)
-  set(MACRO_ARCH SPIRV32)
-elseif(ARCH STREQUAL spirv64)
-  set(MACRO_ARCH SPIRV64)
-elseif(ARCH STREQUAL clspv)
-  set(MACRO_ARCH CLSPV32)
-elseif(ARCH STREQUAL clspv64)
-  set(MACRO_ARCH CLSPV64)
+if(ARCH STREQUAL spirv OR ARCH STREQUAL spirv64)
----------------
jhuber6 wrote:

This is the legacy path that doesn't use the SPIR-V backend. I thought about 
removing it but I wanted to be cautious. I think a follow-up PR that fully 
deprecates and removes this while fully relying on the SPIR-V backend  would be 
ideal.

https://github.com/llvm/llvm-project/pull/196351
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to