Files
TheRock/compiler/amd-llvm/mlir/test/Target/LLVMIR/omptarget-groupprivate.mlir
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

42 lines
2.0 KiB
MLIR

// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s
module attributes {omp.is_target_device = true, llvm.target_triple = "amdgcn-amd-amdhsa",
dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memory_space", 5 : ui32>>} {
llvm.func @_QQmain() attributes {fir.bindc_name = "main"} {
%ga = llvm.mlir.addressof @global_a : !llvm.ptr
%map_a = omp.map.info var_ptr(%ga : !llvm.ptr, i32) map_clauses(tofrom) capture(ByCopy) -> !llvm.ptr {name = "i"}
omp.target map_entries(%map_a -> %arg1 : !llvm.ptr) {
%loaded = llvm.load %arg1 : !llvm.ptr -> i32
%any_gp = omp.groupprivate @global_any device_type(any) : !llvm.ptr
llvm.store %loaded, %any_gp : i32, !llvm.ptr
%host_gp = omp.groupprivate @global_host device_type(host) : !llvm.ptr
llvm.store %loaded, %host_gp : i32, !llvm.ptr
%nohost_gp = omp.groupprivate @global_nohost device_type(nohost) : !llvm.ptr
llvm.store %loaded, %nohost_gp : i32, !llvm.ptr
omp.terminator
}
llvm.return
}
llvm.mlir.global internal @global_a() : i32
llvm.mlir.global internal @global_any() : i32
llvm.mlir.global internal @global_host() : i32
llvm.mlir.global internal @global_nohost() : i32
}
// CHECK-DAG: @global_a = internal global i32 undef
// CHECK-DAG: @global_any = internal global i32 undef
// CHECK-DAG: @global_host = internal global i32 undef
// CHECK-DAG: @global_nohost = internal global i32 undef
// CHECK-DAG: @[[SHARED_ANY:global_any.*]] = internal addrspace(3) global i32 poison
// CHECK-DAG: @[[SHARED_NOHOST:global_nohost.*]] = internal addrspace(3) global i32 poison
// CHECK: define {{.*}} amdgpu_kernel void @__omp_offloading_{{.*}}_{{.*}}__QQmain_{{.*}}(ptr %{{.*}}, ptr %{{.*}}) #{{[0-9]+}} {
// CHECK: %[[LOAD:.*]] = load i32, ptr %{{.*}}, align 4
// CHECK-NEXT : store i32 %[[LOAD]], ptr addrspace(3) @[[SHARED_ANY]], align 4
// CHECK-NEXT : store i32 %[[LOAD]], ptr @global_host, align 4
// CHECK-NEXT : store i32 %[[LOAD]], ptr addrspace(3) @[[SHARED_NOHOST]], align 4