================
@@ -454,10 +454,22 @@ function(add_libclc_builtin_set)
 
     set( obj_suffix ${ARG_ARCH_SUFFIX}.bc )
     set( libclc_builtins_lib ${LIBCLC_OUTPUT_LIBRARY_DIR}/${obj_suffix} )
-    add_custom_command( OUTPUT ${libclc_builtins_lib}
-      COMMAND ${prepare_builtins_exe} -o ${libclc_builtins_lib} 
${builtins_opt_lib}
-      DEPENDS ${builtins_opt_lib} ${builtins_opt_lib_tgt} 
${prepare_builtins_target}
-    )
+    if( TARGET prepare_builtins )
+      # FIXME: Is this utility even necessary? The `-mlink-builtin-bitcode`
+      # option used to link the library in discards the modified linkage.
----------------
jhuber6 wrote:

The two things it does from what I can tell

1. Removes `"opencl.ocl.version"` metadata strings

2. Replaces any non-external function with `linkonce_odr` linkage

The first one, I'm pretty sure `llvm-link` deduplicates now. For the second 
one, this is mostly just a cheap way to let the functions link while being 
eliminated by the compiler if unused. I think the ROCm Device Libs do that as 
well

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

Reply via email to