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
131 lines
5.4 KiB
LLVM
131 lines
5.4 KiB
LLVM
; RUN: llc -O0 -mtriple=spirv64-- %s -o - | FileCheck %s
|
|
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-- %s -o - -filetype=obj | spirv-val %}
|
|
|
|
; RUN: llc -O0 -mtriple=spirv32-- %s -o - | FileCheck %s
|
|
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-- %s -o - -filetype=obj | spirv-val %}
|
|
|
|
; Check that 'store atomic' LLVM IR instructions are lowered correctly to
|
|
; OpAtomicStore with the right Scope and Memory Semantics operands.
|
|
;
|
|
; Ordering bits are combined with storage-class semantics (e.g. CrossWorkgroupMemory
|
|
; 0x200 for ptr addrspace(1), WorkgroupMemory 0x100 for ptr addrspace(3)).
|
|
|
|
; CHECK-DAG: %[[#Int32:]] = OpTypeInt 32 0
|
|
; CHECK-DAG: %[[#Float:]] = OpTypeFloat 32
|
|
; CHECK-DAG: %[[#Const0:]] = OpConstantNull %[[#Int32]]
|
|
; CHECK-DAG: %[[#Const1:]] = OpConstant %[[#Int32]] 1{{$}}
|
|
; CHECK-DAG: %[[#Const2:]] = OpConstant %[[#Int32]] 2{{$}}
|
|
; CHECK-DAG: %[[#Const3:]] = OpConstant %[[#Int32]] 3{{$}}
|
|
; CHECK-DAG: %[[#Const4:]] = OpConstant %[[#Int32]] 4{{$}}
|
|
; CHECK-DAG: %[[#Const260:]] = OpConstant %[[#Int32]] 260{{$}}
|
|
; CHECK-DAG: %[[#Const512:]] = OpConstant %[[#Int32]] 512{{$}}
|
|
; CHECK-DAG: %[[#Const516:]] = OpConstant %[[#Int32]] 516{{$}}
|
|
; CHECK-DAG: %[[#Const528:]] = OpConstant %[[#Int32]] 528{{$}}
|
|
|
|
define void @store_i32_unordered(ptr addrspace(1) %ptr, i32 %val) {
|
|
; CHECK-LABEL: OpFunction %[[#]]
|
|
; CHECK: %[[#ptr:]] = OpFunctionParameter %[[#]]
|
|
; CHECK: %[[#val:]] = OpFunctionParameter %[[#Int32]]
|
|
; CHECK: OpAtomicStore %[[#ptr]] %[[#Const0]] %[[#Const512]] %[[#val]]
|
|
; CHECK: OpReturn
|
|
store atomic i32 %val, ptr addrspace(1) %ptr unordered, align 4
|
|
ret void
|
|
}
|
|
|
|
define void @store_i32_monotonic(ptr addrspace(1) %ptr, i32 %val) {
|
|
; CHECK-LABEL: OpFunction %[[#]]
|
|
; CHECK: %[[#ptr:]] = OpFunctionParameter %[[#]]
|
|
; CHECK: %[[#val:]] = OpFunctionParameter %[[#Int32]]
|
|
; CHECK: OpAtomicStore %[[#ptr]] %[[#Const0]] %[[#Const512]] %[[#val]]
|
|
; CHECK: OpReturn
|
|
store atomic i32 %val, ptr addrspace(1) %ptr monotonic, align 4
|
|
ret void
|
|
}
|
|
|
|
define void @store_i32_release(ptr addrspace(1) %ptr, i32 %val) {
|
|
; CHECK-LABEL: OpFunction %[[#]]
|
|
; CHECK: %[[#ptr:]] = OpFunctionParameter %[[#]]
|
|
; CHECK: %[[#val:]] = OpFunctionParameter %[[#Int32]]
|
|
; CHECK: OpAtomicStore %[[#ptr]] %[[#Const0]] %[[#Const516]] %[[#val]]
|
|
; CHECK: OpReturn
|
|
store atomic i32 %val, ptr addrspace(1) %ptr release, align 4
|
|
ret void
|
|
}
|
|
|
|
define void @store_i32_seq_cst(ptr addrspace(1) %ptr, i32 %val) {
|
|
; CHECK-LABEL: OpFunction %[[#]]
|
|
; CHECK: %[[#ptr:]] = OpFunctionParameter %[[#]]
|
|
; CHECK: %[[#val:]] = OpFunctionParameter %[[#Int32]]
|
|
; CHECK: OpAtomicStore %[[#ptr]] %[[#Const0]] %[[#Const528]] %[[#val]]
|
|
; CHECK: OpReturn
|
|
store atomic i32 %val, ptr addrspace(1) %ptr seq_cst, align 4
|
|
ret void
|
|
}
|
|
|
|
; -- test with different syncscopes
|
|
|
|
define void @store_i32_release_singlethread(ptr addrspace(1) %ptr, i32 %val) {
|
|
; CHECK-LABEL: OpFunction %[[#]]
|
|
; CHECK: %[[#ptr:]] = OpFunctionParameter %[[#]]
|
|
; CHECK: %[[#val:]] = OpFunctionParameter %[[#Int32]]
|
|
; CHECK: OpAtomicStore %[[#ptr]] %[[#Const4]] %[[#Const516]] %[[#val]]
|
|
; CHECK: OpReturn
|
|
store atomic i32 %val, ptr addrspace(1) %ptr syncscope("singlethread") release, align 4
|
|
ret void
|
|
}
|
|
|
|
define void @store_i32_release_subgroup(ptr addrspace(1) %ptr, i32 %val) {
|
|
; CHECK-LABEL: OpFunction %[[#]]
|
|
; CHECK: %[[#ptr:]] = OpFunctionParameter %[[#]]
|
|
; CHECK: %[[#val:]] = OpFunctionParameter %[[#Int32]]
|
|
; CHECK: OpAtomicStore %[[#ptr]] %[[#Const3]] %[[#Const516]] %[[#val]]
|
|
; CHECK: OpReturn
|
|
store atomic i32 %val, ptr addrspace(1) %ptr syncscope("subgroup") release, align 4
|
|
ret void
|
|
}
|
|
|
|
define void @store_i32_release_workgroup(ptr addrspace(1) %ptr, i32 %val) {
|
|
; CHECK-LABEL: OpFunction %[[#]]
|
|
; CHECK: %[[#ptr:]] = OpFunctionParameter %[[#]]
|
|
; CHECK: %[[#val:]] = OpFunctionParameter %[[#Int32]]
|
|
; CHECK: OpAtomicStore %[[#ptr]] %[[#Const2]] %[[#Const516]] %[[#val]]
|
|
; CHECK: OpReturn
|
|
store atomic i32 %val, ptr addrspace(1) %ptr syncscope("workgroup") release, align 4
|
|
ret void
|
|
}
|
|
|
|
define void @store_i32_release_device(ptr addrspace(1) %ptr, i32 %val) {
|
|
; CHECK-LABEL: OpFunction %[[#]]
|
|
; CHECK: %[[#ptr:]] = OpFunctionParameter %[[#]]
|
|
; CHECK: %[[#val:]] = OpFunctionParameter %[[#Int32]]
|
|
; CHECK: OpAtomicStore %[[#ptr]] %[[#Const1]] %[[#Const516]] %[[#val]]
|
|
; CHECK: OpReturn
|
|
store atomic i32 %val, ptr addrspace(1) %ptr syncscope("device") release, align 4
|
|
ret void
|
|
}
|
|
|
|
; -- test with a different scalar type
|
|
|
|
define void @store_float_release(ptr addrspace(1) %ptr, float %val) {
|
|
; CHECK-LABEL: OpFunction %[[#]]
|
|
; CHECK: %[[#ptr:]] = OpFunctionParameter %[[#]]
|
|
; CHECK: %[[#val:]] = OpFunctionParameter %[[#Float]]
|
|
; CHECK: %[[#cast:]] = OpBitcast %[[#Int32]] %[[#val]]
|
|
; CHECK: OpAtomicStore %[[#ptr]] %[[#Const0]] %[[#Const516]] %[[#cast]]
|
|
; CHECK: OpReturn
|
|
store atomic float %val, ptr addrspace(1) %ptr release, align 8
|
|
ret void
|
|
}
|
|
|
|
; -- test with a different addrspace
|
|
|
|
define void @store_i32_release_device_workgroup(ptr addrspace(3) %ptr, i32 %val) {
|
|
; CHECK-LABEL: OpFunction %[[#]]
|
|
; CHECK: %[[#ptr:]] = OpFunctionParameter %[[#]]
|
|
; CHECK: %[[#val:]] = OpFunctionParameter %[[#Int32]]
|
|
; CHECK: OpAtomicStore %[[#ptr]] %[[#Const1]] %[[#Const260]] %[[#val]]
|
|
; CHECK: OpReturn
|
|
store atomic i32 %val, ptr addrspace(3) %ptr syncscope("device") release, align 4
|
|
ret void
|
|
}
|