Files
TheRock/compiler/amd-llvm/flang/test/Lower/forall/forall-construct.f90
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

52 lines
2.2 KiB
Fortran

! Test forall lowering
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s
!*** Test a FORALL construct
subroutine test_forall_construct(a,b)
integer :: i, j
real :: a(:,:), b(:,:)
forall (i=1:ubound(a,1), j=1:ubound(a,2), b(j,i) > 0.0)
a(i,j) = b(j,i) / 3.14
end forall
end subroutine test_forall_construct
! CHECK-LABEL: func.func @_QPtest_forall_construct(
! CHECK-SAME: %[[ARG0:.*]]: !fir.box<!fir.array<?x?xf32>>{{.*}}, %[[ARG1:.*]]: !fir.box<!fir.array<?x?xf32>>{{.*}}) {
! CHECK: %[[VAL_1:.*]]:2 = hlfir.declare %[[ARG0]]
! CHECK: %[[VAL_2:.*]]:2 = hlfir.declare %[[ARG1]]
! CHECK: hlfir.forall lb {
! CHECK: hlfir.yield %{{.*}} : i32
! CHECK: } ub {
! CHECK: hlfir.yield %{{.*}} : i32
! CHECK: } (%[[I:.*]]: i32) {
! CHECK: %[[IDX_I:.*]] = hlfir.forall_index "i" %[[I]]
! CHECK: hlfir.forall lb {
! CHECK: hlfir.yield %{{.*}} : i32
! CHECK: } ub {
! CHECK: hlfir.yield %{{.*}} : i32
! CHECK: } (%[[J:.*]]: i32) {
! CHECK: %[[IDX_J:.*]] = hlfir.forall_index "j" %[[J]]
! CHECK: hlfir.forall_mask {
! CHECK: %[[VAL_J:.*]] = fir.load %[[IDX_J]]
! CHECK: %[[VAL_I:.*]] = fir.load %[[IDX_I]]
! CHECK: %[[B_JI_REF:.*]] = hlfir.designate %[[VAL_2]]#0 (%{{.*}}, %{{.*}})
! CHECK: %[[B_JI:.*]] = fir.load %[[B_JI_REF]]
! CHECK: %[[COND:.*]] = arith.cmpf ogt, %[[B_JI]], %{{.*}}
! CHECK: hlfir.yield %[[COND]] : i1
! CHECK: } do {
! CHECK: hlfir.region_assign {
! CHECK: %[[B_JI_REF2:.*]] = hlfir.designate %[[VAL_2]]#0 (%{{.*}}, %{{.*}})
! CHECK: %[[B_JI2:.*]] = fir.load %[[B_JI_REF2]]
! CHECK: %[[RES:.*]] = arith.divf %[[B_JI2]], %{{.*}}
! CHECK: hlfir.yield %[[RES]] : f32
! CHECK: } to {
! CHECK: %[[A_IJ_REF:.*]] = hlfir.designate %[[VAL_1]]#0 (%{{.*}}, %{{.*}})
! CHECK: hlfir.yield %[[A_IJ_REF]] : !fir.ref<f32>
! CHECK: }
! CHECK: }
! CHECK: }
! CHECK: }
! CHECK: return
! CHECK: }