[PATCH] D156440: [llvm 16] libclc: disable opaque pointers when compiling to SPIR-V

Karol Herbst via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 08:13:43 PDT 2023


karolherbst created this revision.
Herald added subscribers: pmatos, jvesely.
Herald added a project: All.
karolherbst requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

There are still some regressions around opaque types like Event. Let's disable it for LLVM-16.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156440

Files:
  libclc/CMakeLists.txt


Index: libclc/CMakeLists.txt
===================================================================
--- libclc/CMakeLists.txt
+++ libclc/CMakeLists.txt
@@ -89,6 +89,7 @@
 set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
 set( CMAKE_CLC_COMPILER ${LLVM_CLANG} )
 set( CMAKE_CLC_ARCHIVE ${LLVM_LINK} )
+set( CMAKE_CLC_CREATE_STATIC_LIBRARY "<CMAKE_CLC_ARCHIVE> <LINK_FLAGS> -o <TARGET> <OBJECTS>" )
 set( CMAKE_LLAsm_PREPROCESSOR ${LLVM_CLANG} )
 set( CMAKE_LLAsm_COMPILER ${LLVM_AS} )
 set( CMAKE_LLAsm_ARCHIVE ${LLVM_LINK} )
@@ -266,19 +267,23 @@
 			else()
 				set( t "spir64--" )
 			endif()
-			set( build_flags -O0 -finline-hint-functions )
-			set( opt_flags )
-			set( spvflags --spirv-max-version=1.1 )
+			set( build_flags -O0 -finline-hint-functions -Xclang -no-opaque-pointers )
+			set( linker_flags --opaque-pointers=0 )
+			set( opt_flags --opaque-pointers=0 )
+			set( spvflags -opaque-pointers=0 --spirv-max-version=1.1 )
 		elseif( ${ARCH} STREQUAL "clspv" )
 			set( t "spir--" )
 			set( build_flags )
+			set( linker_flags )
 			set( opt_flags -O3 )
 		elseif( ${ARCH} STREQUAL "clspv64" )
 			set( t "spir64--" )
 			set( build_flags )
+			set( linker_flags )
 			set( opt_flags -O3 )
 		else()
 			set( build_flags )
+			set( linker_flags )
 			set( opt_flags -O3 )
 		endif()
 
@@ -298,7 +303,8 @@
 		target_compile_options( builtins.link.${arch_suffix} PRIVATE  -target
 			${t} ${mcpu} -fno-builtin -nostdlib ${build_flags} )
 		set_target_properties( builtins.link.${arch_suffix} PROPERTIES
-			LINKER_LANGUAGE CLC )
+			LINKER_LANGUAGE CLC
+			STATIC_LIBRARY_OPTIONS "${linker_flags}" )
 
 		set( obj_suffix ${arch_suffix}.bc )
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156440.544782.patch
Type: text/x-patch
Size: 1656 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230727/6affd323/attachment.bin>


More information about the llvm-commits mailing list