[Openmp-commits] [openmp] eda4ef3 - [Libomptarget] Add `leaf` attribute to `vprintf` declaration

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Thu May 19 11:23:28 PDT 2022


Author: Joseph Huber
Date: 2022-05-19T14:22:53-04:00
New Revision: eda4ef3add4d25345e0b29580776f1576040c525

URL: https://github.com/llvm/llvm-project/commit/eda4ef3add4d25345e0b29580776f1576040c525
DIFF: https://github.com/llvm/llvm-project/commit/eda4ef3add4d25345e0b29580776f1576040c525.diff

LOG: [Libomptarget] Add `leaf` attribute to `vprintf` declaration

Summary:
This patch adds the `leaf` attribute to the `vprintf` declaration in the
OpenMP runtime. This attribute allows us to determine that the `vprintf`
function will not call any functions within the translation unit,
allowing us to deduce `norecurse` attributes on the caller.

Added: 
    

Modified: 
    openmp/libomptarget/DeviceRTL/src/Debug.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/DeviceRTL/src/Debug.cpp b/openmp/libomptarget/DeviceRTL/src/Debug.cpp
index 45e08fa5b16b..c6cf5071b95d 100644
--- a/openmp/libomptarget/DeviceRTL/src/Debug.cpp
+++ b/openmp/libomptarget/DeviceRTL/src/Debug.cpp
@@ -36,7 +36,7 @@ int32_t omp_vprintf(const char *Format, void *Arguments, uint32_t);
 
 #pragma omp begin declare variant match(                                       \
     device = {arch(nvptx, nvptx64)}, implementation = {extension(match_any)})
-int32_t vprintf(const char *, void *);
+int32_t __attribute__((leaf)) vprintf(const char *, void *);
 namespace impl {
 int32_t omp_vprintf(const char *Format, void *Arguments, uint32_t) {
   return vprintf(Format, Arguments);


        


More information about the Openmp-commits mailing list