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
75 lines
3.5 KiB
Fortran
75 lines
3.5 KiB
Fortran
!RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - | FileCheck %s
|
|
|
|
!CHECK: func.func @_QQmain() attributes {fir.bindc_name = "SAMPLE"} {
|
|
!CHECK: %[[val_0:.*]] = fir.alloca i32 {bindc_name = "a", uniq_name = "_QFEa"}
|
|
!CHECK: %[[val_1:.*]]:2 = hlfir.declare %[[val_0]] {uniq_name = "_QFEa"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
|
|
!CHECK: %[[val_2:.*]] = fir.alloca i32 {bindc_name = "b", uniq_name = "_QFEb"}
|
|
!CHECK: %[[val_3:.*]]:2 = hlfir.declare %[[val_2]] {uniq_name = "_QFEb"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
|
|
!CHECK: %[[val_4:.*]] = fir.alloca i32 {bindc_name = "x", uniq_name = "_QFEx"}
|
|
!CHECK: %[[val_5:.*]]:2 = hlfir.declare %[[val_4]] {uniq_name = "_QFEx"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
|
|
!CHECK: %[[val_c5:.*]] = arith.constant 5 : index
|
|
!CHECK: %[[val_6:.*]] = fir.alloca !fir.array<5xi32> {bindc_name = "y", uniq_name = "_QFEy"}
|
|
!CHECK: %[[val_7:.*]] = fir.shape %[[val_c5]] : (index) -> !fir.shape<1>
|
|
!CHECK: %[[val_8:.*]]:2 = hlfir.declare %[[val_6]](%[[val_7]]) {uniq_name = "_QFEy"} : (!fir.ref<!fir.array<5xi32>>, !fir.shape<1>) -> (!fir.ref<!fir.array<5xi32>>, !fir.ref<!fir.array<5xi32>>)
|
|
!CHECK: %[[val_c2:.*]] = arith.constant 2 : index
|
|
!CHECK: %[[val_9:.*]] = hlfir.designate %[[val_8]]#0 (%[[val_c2]]) : (!fir.ref<!fir.array<5xi32>>, index) -> !fir.ref<i32>
|
|
!CHECK: %[[val_c8:.*]] = arith.constant 8 : i32
|
|
!CHECK: %[[val_10:.*]] = fir.load %[[val_5]]#0 : !fir.ref<i32>
|
|
!CHECK: %[[val_11:.*]] = arith.addi %[[val_c8]], %[[val_10]] : i32
|
|
!CHECK: %[[val_12:.*]] = hlfir.no_reassoc %[[val_11]] : i32
|
|
!CHECK: omp.atomic.update memory_order(relaxed) %[[val_9]] : !fir.ref<i32> {
|
|
!CHECK: ^bb0(%[[ARG:.*]]: i32):
|
|
!CHECK: %[[val_18:.*]] = arith.muli %[[val_12]], %[[ARG]] : i32
|
|
!CHECK: omp.yield(%[[val_18]] : i32)
|
|
!CHECK: }
|
|
!CHECK: %[[val_c2_0:.*]] = arith.constant 2 : index
|
|
!CHECK: %[[val_13:.*]] = hlfir.designate %[[val_8]]#0 (%[[val_c2_0]]) : (!fir.ref<!fir.array<5xi32>>, index) -> !fir.ref<i32>
|
|
!CHECK: %[[val_c8_1:.*]] = arith.constant 8 : i32
|
|
!CHECK: omp.atomic.update memory_order(relaxed) %[[val_13:.*]] : !fir.ref<i32> {
|
|
!CHECK: ^bb0(%[[ARG:.*]]: i32):
|
|
!CHECK: %[[val_18:.*]] = arith.divsi %[[ARG]], %[[val_c8_1]] : i32
|
|
!CHECK: omp.yield(%[[val_18]] : i32)
|
|
!CHECK: }
|
|
!CHECK: %[[val_c8_2:.*]] = arith.constant 8 : i32
|
|
!CHECK: %[[val_c4:.*]] = arith.constant 4 : index
|
|
!CHECK: %[[val_14:.*]] = hlfir.designate %[[val_8]]#0 (%[[val_c4]]) : (!fir.ref<!fir.array<5xi32>>, index) -> !fir.ref<i32>
|
|
!CHECK: %[[val_15:.*]] = fir.load %[[val_14]] : !fir.ref<i32>
|
|
!CHECK: %[[val_16:.*]] = arith.addi %[[val_c8_2]], %[[val_15]] : i32
|
|
!CHECK: %[[val_17:.*]] = hlfir.no_reassoc %[[val_16]] : i32
|
|
!CHECK: omp.atomic.update memory_order(relaxed) %[[val_5]]#0 : !fir.ref<i32> {
|
|
!CHECK: ^bb0(%[[ARG:.*]]: i32):
|
|
!CHECK: %[[val_18:.*]] = arith.addi %[[val_17]], %[[ARG]] : i32
|
|
!CHECK: omp.yield(%[[val_18]] : i32)
|
|
!CHECK: }
|
|
!CHECK: %[[val_c8_3:.*]] = arith.constant 8 : i32
|
|
!CHECK: omp.atomic.update memory_order(relaxed) %[[val_5]]#0 : !fir.ref<i32> {
|
|
!CHECK: ^bb0(%[[ARG]]: i32):
|
|
!CHECK: %[[val_18:.*]] = arith.subi %[[val_c8_3]], %[[ARG]] : i32
|
|
!CHECK: omp.yield(%[[val_18]] : i32)
|
|
!CHECK: }
|
|
!CHECK: return
|
|
!CHECK: }
|
|
program sample
|
|
|
|
integer :: x
|
|
integer, dimension(5) :: y
|
|
integer :: a, b
|
|
|
|
!$omp atomic update
|
|
y(2) = (8 + x) * y(2)
|
|
!$omp end atomic
|
|
|
|
!$omp atomic update
|
|
y(2) = y(2) / 8
|
|
!$omp end atomic
|
|
|
|
!$omp atomic update
|
|
x = (8 + y(4)) + x
|
|
!$omp end atomic
|
|
|
|
!$omp atomic update
|
|
x = 8 - x
|
|
!$omp end atomic
|
|
|
|
end program sample
|