[flang-commits] [flang] 0e76496 - [flang][openacc] Fix post deallocate suffix
Valentin Clement via flang-commits
flang-commits at lists.llvm.org
Wed Aug 16 11:09:48 PDT 2023
Author: Valentin Clement
Date: 2023-08-16T11:09:42-07:00
New Revision: 0e7649698a2f4b41159b0203147cf4beca07b0bc
URL: https://github.com/llvm/llvm-project/commit/0e7649698a2f4b41159b0203147cf4beca07b0bc
DIFF: https://github.com/llvm/llvm-project/commit/0e7649698a2f4b41159b0203147cf4beca07b0bc.diff
LOG: [flang][openacc] Fix post deallocate suffix
The wrong suffix was applied
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D158098
Added:
Modified:
flang/lib/Lower/OpenACC.cpp
flang/test/Lower/OpenACC/acc-declare.f90
Removed:
################################################################################
diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp
index b00b719bb66714..c884b3e767dff8 100644
--- a/flang/lib/Lower/OpenACC.cpp
+++ b/flang/lib/Lower/OpenACC.cpp
@@ -2854,7 +2854,7 @@ void Fortran::lower::attachDeclarePostDeallocAction(
AbstractConverter &converter, fir::FirOpBuilder &builder,
const Fortran::semantics::Symbol &sym) {
std::stringstream fctName;
- fctName << converter.mangleName(sym) << declarePostAllocSuffix.str();
+ fctName << converter.mangleName(sym) << declarePostDeallocSuffix.str();
mlir::Operation &op = builder.getInsertionBlock()->back();
op.setAttr(mlir::acc::getDeclareActionAttrName(),
mlir::acc::DeclareActionAttr::get(
diff --git a/flang/test/Lower/OpenACC/acc-declare.f90 b/flang/test/Lower/OpenACC/acc-declare.f90
index 6761e640100c59..1ba42426d97f80 100644
--- a/flang/test/Lower/OpenACC/acc-declare.f90
+++ b/flang/test/Lower/OpenACC/acc-declare.f90
@@ -279,7 +279,7 @@ subroutine acc_declare_allocate()
! CHECK: %{{.*}} = fir.box_addr %{{.*}} {acc.declare_action = #acc.declare_action<preDealloc = @_QMacc_declareFacc_declare_allocateEa_acc_declare_update_desc_pre_dealloc>} : (!fir.box<!fir.heap<!fir.array<?xi32>>>) -> !fir.heap<!fir.array<?xi32>>
! CHECK: fir.freemem %{{.*}} : !fir.heap<!fir.array<?xi32>>
-! CHECK: fir.store %{{.*}} to %{{.*}} {acc.declare_action = #acc.declare_action<postDealloc = @_QMacc_declareFacc_declare_allocateEa_acc_declare_update_desc_post_alloc>} : !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>
+! CHECK: fir.store %{{.*}} to %{{.*}} {acc.declare_action = #acc.declare_action<postDealloc = @_QMacc_declareFacc_declare_allocateEa_acc_declare_update_desc_post_dealloc>} : !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>
end subroutine
@@ -347,6 +347,6 @@ subroutine finalize()
use acc_declare_allocatable_test
deallocate(data1)
! CHECK: %{{.*}} = fir.box_addr %{{.*}} {acc.declare_action = #acc.declare_action<preDealloc = @_QMacc_declare_allocatable_testEdata1_acc_declare_update_desc_pre_dealloc>} : (!fir.box<!fir.heap<!fir.array<?xi32>>>) -> !fir.heap<!fir.array<?xi32>>
-! CHECK: fir.store %{{.*}} to %{{.*}} {acc.declare_action = #acc.declare_action<postDealloc = @_QMacc_declare_allocatable_testEdata1_acc_declare_update_desc_post_alloc>} : !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>
+! CHECK: fir.store %{{.*}} to %{{.*}} {acc.declare_action = #acc.declare_action<postDealloc = @_QMacc_declare_allocatable_testEdata1_acc_declare_update_desc_post_dealloc>} : !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>
end subroutine
end module
More information about the flang-commits
mailing list