[flang-commits] [flang] [Flang][OpenMP] Replace fir.store with hlfir.assign in OpenMP single … (PR #70164)

via flang-commits flang-commits at lists.llvm.org
Tue Oct 24 22:19:52 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-fir-hlfir

Author: None (harishch4)

<details>
<summary>Changes</summary>

…test

This fixes failures from a recent merge.
[Flang][OpenMP] Port OpenMP single tests to hlfir flow (https://github.com/llvm/llvm-project/pull/69877)

---
Full diff: https://github.com/llvm/llvm-project/pull/70164.diff


1 Files Affected:

- (modified) flang/test/Lower/OpenMP/single.f90 (+4-4) 


``````````diff
diff --git a/flang/test/Lower/OpenMP/single.f90 b/flang/test/Lower/OpenMP/single.f90
index b336445c7ac9003..ffc41af84e3c217 100644
--- a/flang/test/Lower/OpenMP/single.f90
+++ b/flang/test/Lower/OpenMP/single.f90
@@ -81,8 +81,8 @@ end subroutine single_allocate
 ! CHECK:             %[[X_PVT_DECL:.*]]:2 = hlfir.declare %[[X_PVT]] {uniq_name = "_QFsingle_privatizationEx"} : (!fir.ref<f32>) -> (!fir.ref<f32>, !fir.ref<f32>)
 ! CHECK:             %[[Y_PVT:.*]] = fir.alloca f64 {bindc_name = "y", pinned, uniq_name = "_QFsingle_privatizationEy"}
 ! CHECK:             %[[Y_PVT_DECL:.*]]:2 = hlfir.declare %[[Y_PVT]] {uniq_name = "_QFsingle_privatizationEy"} : (!fir.ref<f64>) -> (!fir.ref<f64>, !fir.ref<f64>)
-! CHECK:             %[[Y_LOAD:.*]] = fir.load %[[Y_DECL]]#1 : !fir.ref<f64>
-! CHECK:             fir.store %[[Y_LOAD]] to %[[Y_PVT_DECL]]#1 : !fir.ref<f64>
+! CHECK:             %[[Y_LOAD:.*]] = fir.load %[[Y_DECL]]#0 : !fir.ref<f64>
+! CHECK:             hlfir.assign %[[Y_LOAD]] to %[[Y_PVT_DECL]]#0 temporary_lhs : f64, !fir.ref<f64>
 ! CHECK:             fir.call @_QPbar(%[[X_PVT_DECL]]#1, %[[Y_PVT_DECL]]#1) fastmath<contract> : (!fir.ref<f32>, !fir.ref<f64>) -> ()
 ! CHECK:           omp.terminator
 ! CHECK:         }
@@ -109,8 +109,8 @@ subroutine single_privatization(x, y)
 ! CHECK:             %[[X_PVT_DECL:.*]]:2 = hlfir.declare %[[X_PVT]] {uniq_name = "_QFsingle_privatization2Ex"} : (!fir.ref<f32>) -> (!fir.ref<f32>, !fir.ref<f32>)
 ! CHECK:             %[[Y_PVT:.*]] = fir.alloca f64 {bindc_name = "y", pinned, uniq_name = "_QFsingle_privatization2Ey"}
 ! CHECK:             %[[Y_PVT_DECL:.*]]:2 = hlfir.declare %[[Y_PVT]] {uniq_name = "_QFsingle_privatization2Ey"} : (!fir.ref<f64>) -> (!fir.ref<f64>, !fir.ref<f64>)
-! CHECK:             %[[Y_LOAD:.*]] = fir.load %[[Y_DECL]]#1 : !fir.ref<f64>
-! CHECK:             fir.store %[[Y_LOAD]] to %[[Y_PVT_DECL]]#1 : !fir.ref<f64>
+! CHECK:             %[[Y_LOAD:.*]] = fir.load %[[Y_DECL]]#0 : !fir.ref<f64>
+! CHECK:             hlfir.assign %[[Y_LOAD]] to %[[Y_PVT_DECL]]#0 temporary_lhs : f64, !fir.ref<f64>
 ! CHECK:             fir.call @_QPbar(%[[X_PVT_DECL]]#1, %[[Y_PVT_DECL]]#1) fastmath<contract> : (!fir.ref<f32>, !fir.ref<f64>) -> ()
 ! CHECK:             omp.terminator
 ! CHECK:           }

``````````

</details>


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


More information about the flang-commits mailing list