[llvm] [AMDGPU] support lib call (PR #74741)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 00:27:05 PST 2024


================
@@ -454,6 +454,10 @@ amdhsa::kernel_descriptor_t AMDGPUAsmPrinter::getAmdhsaKernelDescriptor(
 }
 
 bool AMDGPUAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+  if (MF.getFunction().hasFnAttribute("amdgpu-lib-fun") &&
+      !MF.getFunction().hasFnAttribute("amdgpu-backend-used"))
----------------
Pierre-vh wrote:

Can't `llvm.used` be used instead of a new ad-hoc `amdgpu-backend-used` attribute?
https://llvm.org/docs/LangRef.html#the-llvm-used-global-variable

Also where is `amdgpu-lib-fun` added? If users are expected to add it, it should be documented in `AMDGPUUsage.rst`

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


More information about the llvm-commits mailing list