File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ int main(void) {
4646// CHECK-USM-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]]
4747// CHECK-USM: user_code.entry:
4848// CHECK-USM-NEXT: store i32 1, ptr [[TMP0]], align 4
49- // CHECK-USM-NEXT: [[TMP2:%.*]] = load ptr, ptr addrspace(1) @pGI_decl_tgt_ref_ptr, align 8
49+ // CHECK-USM-NEXT: [[TMP2:%.*]] = load ptr, ptr @pGI_decl_tgt_ref_ptr, align 8
5050// CHECK-USM-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP2]], align 8
5151// CHECK-USM-NEXT: store i32 2, ptr [[TMP3]], align 4
5252// CHECK-USM-NEXT: call void @__kmpc_target_deinit()
Original file line number Diff line number Diff line change @@ -8472,8 +8472,15 @@ GlobalVariable *OpenMPIRBuilder::getOrCreateInternalVariable(
84728472 // create different versions of the function for different OMP internal
84738473 // variables.
84748474 const DataLayout &DL = M.getDataLayout ();
8475- unsigned AddressSpaceVal =
8476- AddressSpace ? *AddressSpace : DL.getDefaultGlobalsAddressSpace ();
8475+ // TODO: Investigate why AMDGPU expects AS 0 for globals even though the
8476+ // default global AS is 1.
8477+ // See double-target-call-with-declare-target.f90 and
8478+ // declare-target-vars-in-target-region.f90 libomptarget
8479+ // tests.
8480+ unsigned AddressSpaceVal = AddressSpace ? *AddressSpace
8481+ : M.getTargetTriple ().isAMDGPU ()
8482+ ? 0
8483+ : DL.getDefaultGlobalsAddressSpace ();
84778484 auto Linkage = this ->M .getTargetTriple ().getArch () == Triple::wasm32
84788485 ? GlobalValue::InternalLinkage
84798486 : GlobalValue::CommonLinkage;
You can’t perform that action at this time.
0 commit comments