[flang-commits] [flang] [flang][OpenMP] Extend `do concurrent` mapping to device (PR #155987)

Pranav Bhandarkar via flang-commits flang-commits at lists.llvm.org
Mon Sep 8 22:00:30 PDT 2025


================
@@ -0,0 +1,83 @@
+! Tests mapping of a basic `do concurrent` loop to
+! `!$omp target teams distribute parallel do`.
+
+! RUN: %flang_fc1 -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=device %s -o - \
+! RUN:   | FileCheck %s
+! RUN: bbc -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=device %s -o - \
+! RUN:   | FileCheck %s
+
+program do_concurrent_basic
+    implicit none
+    integer :: a(10)
+    integer :: i
+
+    ! CHECK-DAG: %[[I_ORIG_ALLOC:.*]] = fir.alloca i32 {bindc_name = "i"}
----------------
bhandarkar-pranav wrote:

In this scenario, `CHECK-DAG` is not needed. The `CHECK` between the two `CHECK-DAG` statements is going to enforce a strict ordering on the `CHECK-DAG` statements. So, in this case, the alloca for `i` will have to come before the `fir.address_of` for `a`.

https://github.com/llvm/llvm-project/pull/155987


More information about the flang-commits mailing list