[clang] [AMDGPU] add function attrbute amdgpu-lib-fun (PR #74737)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 9 12:00:46 PST 2024


================
@@ -2693,6 +2693,17 @@ An error will be given if:
   }];
 }
 
+def AMDGPULibFunDocs : Documentation {
+  let Category = DocCatAMDGPUAttributes;
+  let Content = [{
+The ``amdgpu_lib_fun`` attribute can be applied to a function for AMDGPU target
+to indicate it is a library function which are handled specially in backend.
+An AMDGPU library function is not internalized and can be used to fullfill
+calls generated by LLVM passes or instruction selection. Unused AMDGPU library
+functions will be eliminated by the backend.
----------------
jhuber6 wrote:

The wording is a little confusing here, just what I'm guessing from the jist.
```suggestion
The ``amdgpu_lib_fun`` attribute can be applied to a function for while targeting
AMDGPU to indicate that it will be handled specially by the backend.
A library function will not be optimized out by standard LLVM passes and can be 
used to resolve function calls. These functions will not be emitted by the backend.
```

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


More information about the cfe-commits mailing list