69 lines · plain
1! Tests that if `do concurrent` is indirectly nested in its parent loop, that we2! skip converting the indirectly nested `do concurrent` loop.3 4! RUN: %flang_fc1 -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=host %s -o - \5! RUN: | FileCheck %s --check-prefixes=HOST,COMMON6 7! RUN: %flang_fc1 -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=device %s -o - \8! RUN: | FileCheck %s --check-prefixes=DEVICE,COMMON9 10program main11 integer, parameter :: n = 1012 integer, parameter :: m = 2013 integer, parameter :: l = 3014 integer x;15 integer :: a(n, m, l)16 17 do concurrent(i=1:n)18 do j=1,m19 do concurrent(k=1:l)20 a(i,j,k) = i * j + k21 end do22 end do23 end do24end25 26! HOST: %[[ORIG_J_ALLOC:.*]] = fir.alloca i32 {bindc_name = "j", {{.*}}}27! HOST: %[[ORIG_J_DECL:.*]]:2 = hlfir.declare %[[ORIG_J_ALLOC]]28 29! DEVICE: omp.target {{.*}}map_entries(30! DEVICE-SAME: %{{[[:alnum:]]+}} -> %{{[^,]+}},31! DEVICE-SAME: %{{[[:alnum:]]+}} -> %{{[^,]+}},32! DEVICE-SAME: %{{[[:alnum:]]+}} -> %{{[^,]+}},33! DEVICE-SAME: %{{[^[:space:]]+}} -> %[[I_ARG:[^,]+]],34! DEVICE-SAME: %{{[^[:space:]]+}} -> %[[J_ARG:[^,]+]],35! DEVICE-SAME: %{{[^[:space:]]+}} -> %[[A_ARG:[^,]+]],36! DEVICE-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},37! DEVICE-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},38! DEVICE-SAME: %{{[^[:space:]]+}} -> %{{[^:]+}} :39! DEVICE-SAME: {{.*}}) {40 41! DEVICE: %[[TARGET_J_DECL:.*]]:2 = hlfir.declare %[[J_ARG]] {uniq_name = "_QFEj"}42 43! DEVICE: omp.teams44 45! COMMON: omp.parallel {46 47! DEVICE: omp.distribute48 49! COMMON: omp.wsloop {50! COMMON: omp.loop_nest ({{[^[:space:]]+}}) {{.*}} {51! COMMON: fir.do_loop {{.*}} iter_args(%[[J_IV:.*]] = {{.*}}) -> {{.*}} {52! HOST: fir.store %[[J_IV]] to %[[ORIG_J_DECL]]#053! DEVICE: fir.store %[[J_IV]] to %[[TARGET_J_DECL]]#054 55! COMMON: fir.do_concurrent {56! COMMON: %[[ORIG_K_ALLOC:.*]] = fir.alloca i32 {bindc_name = "k"}57! COMMON: %[[ORIG_K_DECL:.*]]:2 = hlfir.declare %[[ORIG_K_ALLOC]]58! COMMON: fir.do_concurrent.loop (%[[K_IV:.*]]) = {{.*}} {59! COMMON: %[[K_IV_CONV:.*]] = fir.convert %[[K_IV]] : (index) -> i3260! COMMON: fir.store %[[K_IV_CONV]] to %[[ORIG_K_DECL]]#061! COMMON: }62! COMMON: }63! COMMON: }64! COMMON: omp.yield65! COMMON: }66! COMMON: }67! COMMON: omp.terminator68! COMMON: }69