Skip to content

Commit 5b17a86

Browse files
committed
address feedback
1 parent 7ba0800 commit 5b17a86

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

flang/lib/Lower/OpenACC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ genDataExitOperations(fir::FirOpBuilder &builder,
819819
for (mlir::Value operand : operands) {
820820
auto entryOp = mlir::dyn_cast_or_null<EntryOp>(operand.getDefiningOp());
821821
assert(entryOp && "data entry op expected");
822-
auto opLoc = exitLoc ? *exitLoc : entryOp.getLoc();
822+
mlir::Location opLoc = exitLoc ? *exitLoc : entryOp.getLoc();
823823
if constexpr (std::is_same_v<ExitOp, mlir::acc::CopyoutOp> ||
824824
std::is_same_v<ExitOp, mlir::acc::UpdateHostOp>)
825825
builder.create<ExitOp>(

flang/test/Lower/OpenACC/locations.f90

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,17 @@ subroutine acc_loop_fused_locations(arr)
171171
! CHECK: acc.loop
172172
! CHECK: } attributes {collapse = [3]{{.*}}} loc(fused["{{.*}}locations.f90":160:11, "{{.*}}locations.f90":161:5, "{{.*}}locations.f90":162:7, "{{.*}}locations.f90":163:9])
173173

174+
subroutine data_end_locations(arr)
175+
real, dimension(10) :: arr
176+
177+
!$acc data copy(arr)
178+
!CHECK-LABEL: acc.copyin
179+
!CHECK-SAME: loc("{{.*}}locations.f90":177:21)
180+
181+
!$acc end data
182+
!CHECK-LABEL: acc.copyout
183+
!CHECK-SAME: loc("{{.*}}locations.f90":181:11)
184+
end subroutine
174185
end module
175186

176187

0 commit comments

Comments
 (0)