[llvm] 4fea8ee - OpenMP: mark allocptr attribute on __kmpc_free_shared

Augie Fackler via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 9 11:10:19 PDT 2022


Author: Augie Fackler
Date: 2022-09-09T14:09:18-04:00
New Revision: 4fea8ee540aa6767032fe5dcba6edf3b3670ffba

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

LOG: OpenMP: mark allocptr attribute on __kmpc_free_shared

Differential Revision: https://reviews.llvm.org/D124491

Added: 
    

Modified: 
    llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
    llvm/test/Transforms/OpenMP/remove_globalization.ll

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
index 32ca3e2350ab3..6e7c0d3386849 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
@@ -535,11 +535,6 @@ __OMP_ATTRS_SET(InaccessibleArgOnlyAttrs,
                                    EnumAttr(WillReturn), EnumAttr(NoFree))
                     : AttributeSet(EnumAttr(NoUnwind)))
 
-__OMP_ATTRS_SET(NoCaptureAttrs,
-                OptimisticAttributes
-                    ? AttributeSet(EnumAttr(NoCapture))
-                    : AttributeSet(EnumAttr(NoCapture)))
-
 __OMP_ATTRS_SET(AlwaysInlineAttrs,
                 OptimisticAttributes
                     ? AttributeSet(EnumAttr(AlwaysInline))
@@ -925,7 +920,7 @@ __OMP_RTL_ATTRS(__kmpc_alloc_shared, AttributeSet(
   EnumAttr(NoSync),
   AllocSizeAttr(0, None)), ReturnPtrAttrs, ParamAttrs())
 __OMP_RTL_ATTRS(__kmpc_free_shared, DeviceAllocAttrs, AttributeSet(),
-                ParamAttrs(NoCaptureAttrs))
+                ParamAttrs(AttributeSet(EnumAttr(NoCapture), EnumAttr(AllocatedPointer))))
 
 __OMP_RTL_ATTRS(__kmpc_alloc, DefaultAttrs, ReturnPtrAttrs, ParamAttrs())
 __OMP_RTL_ATTRS(__kmpc_aligned_alloc, DefaultAttrs, ReturnPtrAttrs,

diff  --git a/llvm/test/Transforms/OpenMP/remove_globalization.ll b/llvm/test/Transforms/OpenMP/remove_globalization.ll
index 5d538a4241689..6bb3681dc5c47 100644
--- a/llvm/test/Transforms/OpenMP/remove_globalization.ll
+++ b/llvm/test/Transforms/OpenMP/remove_globalization.ll
@@ -155,7 +155,7 @@ entry:
 ; CHECK: declare i8* @__kmpc_alloc_shared(i64)
 declare i8* @__kmpc_alloc_shared(i64)
 
-; CHECK: declare void @__kmpc_free_shared(i8* nocapture, i64)
+; CHECK: declare void @__kmpc_free_shared(i8* allocptr nocapture, i64)
 declare void @__kmpc_free_shared(i8*, i64)
 
 declare void @unknown_no_openmp() "llvm.assume"="omp_no_openmp"


        


More information about the llvm-commits mailing list