[llvm] [Offload] Do not link every target for JIT (PR #92013)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Mon May 13 13:27:30 PDT 2024


================
@@ -28,7 +28,11 @@ if(NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$" AND CMAKE
 endif()
 
 # Create the library and add the default arguments.
-add_target_library(omptarget.rtl.amdgpu AMDGPU)
+if("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD)
----------------
shiltian wrote:

I'd make this same as the argument `LINK_COMPONENTS` of `add_llvm_library`, since it is not always required.  Besides, given `add_target_library` is only for plugin, and only "host" plugin doesn't require that, we can assume almost all plugins need the corresponding target. `add_target_library(omptarget.rtl.amdgpu AMDGPU "")` isn't really beautiful. We can even force `lib_name` to be the target name.

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


More information about the llvm-commits mailing list