[libc-commits] [libc] [libc] Initial support for parsing SPIR-V for GPU libc (PR #128570)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Mon Feb 24 12:42:53 PST 2025


https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/128570

Summary:
Some day we'd like to support this, add some initial support for parsing
the triple so it will at least attempt to build.


>From bfce3e7e90c9a6ac5cf786810abb52e39dc2e6b2 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Mon, 24 Feb 2025 14:41:14 -0600
Subject: [PATCH] [libc] Initial support for parsing SPIR-V for GPU libc

Summary:
Some day we'd like to support this, add some initial support for parsing
the triple so it will at least attempt to build.
---
 libc/cmake/modules/LLVMLibCArchitectures.cmake | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake b/libc/cmake/modules/LLVMLibCArchitectures.cmake
index fbb1091ddabab..b94534bb00980 100644
--- a/libc/cmake/modules/LLVMLibCArchitectures.cmake
+++ b/libc/cmake/modules/LLVMLibCArchitectures.cmake
@@ -53,6 +53,8 @@ function(get_arch_and_system_from_triple triple arch_var sys_var)
     set(target_arch "amdgpu")
   elseif(target_arch MATCHES "^nvptx64")
     set(target_arch "nvptx")
+  elseif(target_arch MATCHES "^spirv64")
+    set(target_arch "spirv64")
   else()
     return()
   endif()
@@ -162,6 +164,8 @@ elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "amdgpu")
   set(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU TRUE)
 elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "nvptx")
   set(LIBC_TARGET_ARCHITECTURE_IS_NVPTX TRUE)
+elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "spirv64")
+  set(LIBC_TARGET_ARCHITECTURE_IS_SPIRV TRUE)
 else()
   message(FATAL_ERROR
           "Unsupported libc target architecture ${LIBC_TARGET_ARCHITECTURE}")



More information about the libc-commits mailing list