[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:18:13 PDT 2023


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

…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)

>From 6f4246d11997e3c42905ee298b4012a02e566477 Mon Sep 17 00:00:00 2001
From: Harish Chambeti <harishcse44 at gmail.com>
Date: Wed, 25 Oct 2023 10:39:26 +0530
Subject: [PATCH] [Flang][OpenMP] Replace fir.store with hlfir.assign in OpenMP
 single test

---
 flang/test/Lower/OpenMP/single.f90 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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:           }



More information about the flang-commits mailing list