Skip to content

Commit 03f6222

Browse files
committed
Update
1 parent eaa00ef commit 03f6222

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,11 +2052,9 @@ Address CGOpenMPRuntimeGPU::getAddressOfLocalVariable(CodeGenFunction &CGF,
20522052
case OMPAllocateDeclAttr::OMPDefaultMemAlloc:
20532053
case OMPAllocateDeclAttr::OMPHighBWMemAlloc:
20542054
case OMPAllocateDeclAttr::OMPLowLatMemAlloc:
2055-
AS = LangAS::opencl_global;
20562055
break;
20572056
case OMPAllocateDeclAttr::OMPThreadMemAlloc:
2058-
AS = LangAS::opencl_private;
2059-
break;
2057+
return Address::invalid();
20602058
case OMPAllocateDeclAttr::OMPUserDefinedMemAlloc:
20612059
// TODO: implement aupport for user-defined allocators.
20622060
return Address::invalid();
@@ -2212,10 +2210,8 @@ bool CGOpenMPRuntimeGPU::hasAllocateAttributeForGlobalVar(const VarDecl *VD,
22122210
case OMPAllocateDeclAttr::OMPCGroupMemAlloc:
22132211
case OMPAllocateDeclAttr::OMPHighBWMemAlloc:
22142212
case OMPAllocateDeclAttr::OMPLowLatMemAlloc:
2215-
AS = LangAS::opencl_global;
2216-
return true;
22172213
case OMPAllocateDeclAttr::OMPThreadMemAlloc:
2218-
AS = LangAS::opencl_private;
2214+
AS = LangAS::Default;
22192215
return true;
22202216
case OMPAllocateDeclAttr::OMPConstMemAlloc:
22212217
AS = LangAS::cuda_constant;

clang/test/OpenMP/nvptx_allocate_codegen.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ void bar() {
8989
// CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
9090
// CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
9191
// CHECK1-NEXT: store i32 2, ptr @_ZZ4mainE1a, align 4
92-
// CHECK1-NEXT: store double 3.000000e+00, ptr addrspacecast (ptr addrspace(1) @b1 to ptr), align 8
92+
// CHECK1-NEXT: store double 3.000000e+00, ptr @b1, align 8
9393
// CHECK1-NEXT: [[CALL:%.*]] = call noundef i32 @_Z3fooIiET_v() #[[ATTR7:[0-9]+]]
9494
// CHECK1-NEXT: ret i32 [[CALL]]
9595
//
9696
//
9797
// CHECK1-LABEL: define {{[^@]+}}@_Z3fooIiET_v
9898
// CHECK1-SAME: () #[[ATTR1:[0-9]+]] comdat {
9999
// CHECK1-NEXT: entry:
100-
// CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr addrspacecast (ptr addrspace(1) @_ZN2STIiE1mE to ptr), align 4
100+
// CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr @_ZN2STIiE1mE, align 4
101101
// CHECK1-NEXT: store i32 [[TMP0]], ptr @v, align 4
102102
// CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr @v, align 4
103103
// CHECK1-NEXT: ret i32 [[TMP1]]
@@ -119,12 +119,13 @@ void bar() {
119119
// CHECK1-NEXT: entry:
120120
// CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
121121
// CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
122+
// CHECK1-NEXT: [[BAR_A:%.*]] = alloca float, align 4
122123
// CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
123124
// CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
124-
// CHECK1-NEXT: [[TMP0:%.*]] = load float, ptr @bar_a, align 4
125+
// CHECK1-NEXT: [[TMP0:%.*]] = load float, ptr [[BAR_A]], align 4
125126
// CHECK1-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
126127
// CHECK1-NEXT: store double [[CONV]], ptr addrspacecast (ptr addrspace(3) @bar_b to ptr), align 8
127-
// CHECK1-NEXT: call void @_Z3bazRf(ptr noundef nonnull align 4 dereferenceable(4) @bar_a) #[[ATTR7]]
128+
// CHECK1-NEXT: call void @_Z3bazRf(ptr noundef nonnull align 4 dereferenceable(4) [[BAR_A]]) #[[ATTR7]]
128129
// CHECK1-NEXT: ret void
129130
//
130131
//

0 commit comments

Comments
 (0)