Skip to content

Commit 612f05d

Browse files
committed
[Flang][OpenMP] Update MapInfoFinalization to use BlockArgs Interface and modify use_device_ptr/addr to be order independent
This patch primarily updates the MapInfoFinalization pass to utilise the BlockArgument interface. It also shuffles newly added arguments the MapInfoFinalization passes to the end of the BlockArg/Relevant MapInfo lists, instead of one prior to the owning descriptor type. During this it was noted that the use_device_ptr/addr handling of target data was a little bit too order dependent so I've attempted to make it less so, as we cannot depend on argument ordering to be the same as Fortran for any future frontends.
1 parent 4048c64 commit 612f05d

File tree

11 files changed

+293
-80
lines changed

11 files changed

+293
-80
lines changed

flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp

Lines changed: 65 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -125,61 +125,86 @@ class MapInfoFinalizationPass
125125
// TODO: map the addendum segment of the descriptor, similarly to the
126126
// above base address/data pointer member.
127127

128-
auto addOperands = [&](mlir::OperandRange &operandsArr,
129-
mlir::MutableOperandRange &mutableOpRange,
130-
auto directiveOp) {
128+
mlir::omp::MapInfoOp newDescParentMapOp =
129+
builder.create<mlir::omp::MapInfoOp>(
130+
op->getLoc(), op.getResult().getType(), descriptor,
131+
mlir::TypeAttr::get(fir::unwrapRefType(descriptor.getType())),
132+
/*varPtrPtr=*/mlir::Value{},
133+
/*members=*/mlir::SmallVector<mlir::Value>{baseAddr},
134+
/*members_index=*/
135+
mlir::DenseIntElementsAttr::get(
136+
mlir::VectorType::get(
137+
llvm::ArrayRef<int64_t>({1, 1}),
138+
mlir::IntegerType::get(builder.getContext(), 32)),
139+
llvm::ArrayRef<int32_t>({0})),
140+
/*bounds=*/mlir::SmallVector<mlir::Value>{},
141+
builder.getIntegerAttr(builder.getIntegerType(64, false),
142+
op.getMapType().value()),
143+
op.getMapCaptureTypeAttr(), op.getNameAttr(),
144+
op.getPartialMapAttr());
145+
op.replaceAllUsesWith(newDescParentMapOp.getResult());
146+
op->erase();
147+
148+
auto addOperands = [&](mlir::MutableOperandRange &mutableOpRange,
149+
mlir::Operation *directiveOp,
150+
unsigned blockArgInsertIndex = 0) {
151+
if (!llvm::is_contained(mutableOpRange.getAsOperandRange(),
152+
newDescParentMapOp.getResult()))
153+
return;
154+
155+
// There doesn't appear to be a simple way to convert MutableOperandRange
156+
// to a vector currently, so we instead use a for_each to populate our
157+
// vector.
131158
llvm::SmallVector<mlir::Value> newMapOps;
132-
for (size_t i = 0; i < operandsArr.size(); ++i) {
133-
if (operandsArr[i] == op) {
134-
// Push new implicit maps generated for the descriptor.
135-
newMapOps.push_back(baseAddr);
159+
newMapOps.reserve(mutableOpRange.size());
160+
llvm::for_each(
161+
mutableOpRange.getAsOperandRange(),
162+
[&newMapOps](mlir::Value oper) { newMapOps.push_back(oper); });
136163

137-
// for TargetOp's which have IsolatedFromAbove we must align the
138-
// new additional map operand with an appropriate BlockArgument,
139-
// as the printing and later processing currently requires a 1:1
140-
// mapping of BlockArgs to MapInfoOp's at the same placement in
141-
// each array (BlockArgs and MapOperands).
142-
if (directiveOp) {
143-
directiveOp.getRegion().insertArgument(i, baseAddr.getType(), loc);
144-
}
164+
for (auto mapMember : newDescParentMapOp.getMembers()) {
165+
if (llvm::is_contained(mutableOpRange.getAsOperandRange(), mapMember))
166+
continue;
167+
newMapOps.push_back(mapMember);
168+
if (directiveOp) {
169+
directiveOp->getRegion(0).insertArgument(
170+
blockArgInsertIndex, mapMember.getType(), mapMember.getLoc());
171+
blockArgInsertIndex++;
145172
}
146-
newMapOps.push_back(operandsArr[i]);
147173
}
174+
148175
mutableOpRange.assign(newMapOps);
149176
};
177+
178+
auto argIface =
179+
llvm::dyn_cast<mlir::omp::BlockArgOpenMPOpInterface>(target);
180+
150181
if (auto mapClauseOwner =
151182
llvm::dyn_cast<mlir::omp::MapClauseOwningOpInterface>(target)) {
152-
mlir::OperandRange mapOperandsArr = mapClauseOwner.getMapVars();
153183
mlir::MutableOperandRange mapMutableOpRange =
154184
mapClauseOwner.getMapVarsMutable();
155-
mlir::omp::TargetOp targetOp =
156-
llvm::dyn_cast<mlir::omp::TargetOp>(target);
157-
addOperands(mapOperandsArr, mapMutableOpRange, targetOp);
185+
unsigned blockArgInsertIndex =
186+
argIface
187+
? argIface.getMapBlockArgsStart() + argIface.numMapBlockArgs()
188+
: 0;
189+
addOperands(
190+
mapMutableOpRange,
191+
llvm::dyn_cast_or_null<mlir::omp::TargetOp>(argIface.getOperation()),
192+
blockArgInsertIndex);
158193
}
194+
159195
if (auto targetDataOp = llvm::dyn_cast<mlir::omp::TargetDataOp>(target)) {
160-
mlir::OperandRange useDevAddrArr = targetDataOp.getUseDeviceAddrVars();
161196
mlir::MutableOperandRange useDevAddrMutableOpRange =
162197
targetDataOp.getUseDeviceAddrVarsMutable();
163-
addOperands(useDevAddrArr, useDevAddrMutableOpRange, targetDataOp);
164-
}
198+
addOperands(useDevAddrMutableOpRange, target,
199+
argIface.getUseDeviceAddrBlockArgsStart() +
200+
argIface.numUseDeviceAddrBlockArgs());
165201

166-
mlir::Value newDescParentMapOp = builder.create<mlir::omp::MapInfoOp>(
167-
op->getLoc(), op.getResult().getType(), descriptor,
168-
mlir::TypeAttr::get(fir::unwrapRefType(descriptor.getType())),
169-
/*varPtrPtr=*/mlir::Value{},
170-
/*members=*/mlir::SmallVector<mlir::Value>{baseAddr},
171-
/*members_index=*/
172-
mlir::DenseIntElementsAttr::get(
173-
mlir::VectorType::get(
174-
llvm::ArrayRef<int64_t>({1, 1}),
175-
mlir::IntegerType::get(builder.getContext(), 32)),
176-
llvm::ArrayRef<int32_t>({0})),
177-
/*bounds=*/mlir::SmallVector<mlir::Value>{},
178-
builder.getIntegerAttr(builder.getIntegerType(64, false),
179-
op.getMapType().value()),
180-
op.getMapCaptureTypeAttr(), op.getNameAttr(), op.getPartialMapAttr());
181-
op.replaceAllUsesWith(newDescParentMapOp);
182-
op->erase();
202+
mlir::MutableOperandRange useDevPtrMutableOpRange =
203+
targetDataOp.getUseDevicePtrVarsMutable();
204+
addOperands(useDevPtrMutableOpRange, target,
205+
argIface.getUseDevicePtrBlockArgsStart() +
206+
argIface.numUseDevicePtrBlockArgs());
207+
}
183208
}
184209

185210
// We add all mapped record members not directly used in the target region

flang/test/Lower/OpenMP/allocatable-map.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
!HLFIRDIALECT: %[[BOX_OFF:.*]] = fir.box_offset %[[POINTER]]#1 base_addr : (!fir.ref<!fir.box<!fir.ptr<i32>>>) -> !fir.llvm_ptr<!fir.ref<i32>>
55
!HLFIRDIALECT: %[[POINTER_MAP_MEMBER:.*]] = omp.map.info var_ptr(%[[POINTER]]#1 : !fir.ref<!fir.box<!fir.ptr<i32>>>, i32) var_ptr_ptr(%[[BOX_OFF]] : !fir.llvm_ptr<!fir.ref<i32>>) map_clauses(tofrom) capture(ByRef) -> !fir.llvm_ptr<!fir.ref<i32>> {name = ""}
66
!HLFIRDIALECT: %[[POINTER_MAP:.*]] = omp.map.info var_ptr(%[[POINTER]]#1 : !fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.box<!fir.ptr<i32>>) map_clauses(tofrom) capture(ByRef) members(%[[POINTER_MAP_MEMBER]] : [0] : !fir.llvm_ptr<!fir.ref<i32>>) -> !fir.ref<!fir.box<!fir.ptr<i32>>> {name = "point"}
7-
!HLFIRDIALECT: omp.target map_entries(%[[POINTER_MAP_MEMBER]] -> {{.*}}, %[[POINTER_MAP]] -> {{.*}} : !fir.llvm_ptr<!fir.ref<i32>>, !fir.ref<!fir.box<!fir.ptr<i32>>>) {
7+
!HLFIRDIALECT: omp.target map_entries(%[[POINTER_MAP]] -> {{.*}}, %[[POINTER_MAP_MEMBER]] -> {{.*}} : !fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.llvm_ptr<!fir.ref<i32>>) {
88
subroutine pointer_routine()
99
integer, pointer :: point
1010
!$omp target map(tofrom:point)

flang/test/Lower/OpenMP/array-bounds.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module assumed_array_routines
5353
!HOST: %[[VAR_PTR_PTR:.*]] = fir.box_offset %0 base_addr : (!fir.ref<!fir.box<!fir.array<?xi32>>>) -> !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>
5454
!HOST: %[[MAP_INFO_MEMBER:.*]] = omp.map.info var_ptr(%[[INTERMEDIATE_ALLOCA]] : !fir.ref<!fir.box<!fir.array<?xi32>>>, !fir.array<?xi32>) var_ptr_ptr(%[[VAR_PTR_PTR]] : !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>) map_clauses(tofrom) capture(ByRef) bounds(%[[BOUNDS]]) -> !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>> {name = ""}
5555
!HOST: %[[MAP:.*]] = omp.map.info var_ptr(%[[INTERMEDIATE_ALLOCA]] : !fir.ref<!fir.box<!fir.array<?xi32>>>, !fir.box<!fir.array<?xi32>>) map_clauses(tofrom) capture(ByRef) members(%[[MAP_INFO_MEMBER]] : [0] : !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>) -> !fir.ref<!fir.array<?xi32>> {name = "arr_read_write(2:5)"}
56-
!HOST: omp.target map_entries(%[[MAP_INFO_MEMBER]] -> %{{.*}}, %[[MAP]] -> %{{.*}}, {{.*}} -> {{.*}} : !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>, !fir.ref<!fir.array<?xi32>>, !fir.ref<i32>) {
56+
!HOST: omp.target map_entries(%[[MAP]] -> %{{.*}}, {{.*}} -> {{.*}}, %[[MAP_INFO_MEMBER]] -> %{{.*}} : !fir.ref<!fir.array<?xi32>>, !fir.ref<i32>, !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>) {
5757
subroutine assumed_shape_array(arr_read_write)
5858
integer, intent(inout) :: arr_read_write(:)
5959

flang/test/Lower/OpenMP/target.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,9 @@ subroutine omp_target_device_addr
528528
!CHECK: %[[MAP:.*]] = omp.map.info var_ptr({{.*}} : !fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.box<!fir.ptr<i32>>) map_clauses(tofrom) capture(ByRef) members(%[[MAP_MEMBERS]] : [0] : !fir.llvm_ptr<!fir.ref<i32>>) -> !fir.ref<!fir.box<!fir.ptr<i32>>> {name = "a"}
529529
!CHECK: %[[DEV_ADDR_MEMBERS:.*]] = omp.map.info var_ptr({{.*}} : !fir.ref<!fir.box<!fir.ptr<i32>>>, i32) var_ptr_ptr({{.*}} : !fir.llvm_ptr<!fir.ref<i32>>) map_clauses(tofrom) capture(ByRef) -> !fir.llvm_ptr<!fir.ref<i32>> {name = ""}
530530
!CHECK: %[[DEV_ADDR:.*]] = omp.map.info var_ptr({{.*}} : !fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.box<!fir.ptr<i32>>) map_clauses(tofrom) capture(ByRef) members(%[[DEV_ADDR_MEMBERS]] : [0] : !fir.llvm_ptr<!fir.ref<i32>>) -> !fir.ref<!fir.box<!fir.ptr<i32>>> {name = "a"}
531-
!CHECK: omp.target_data map_entries(%[[MAP_MEMBERS]], %[[MAP]] : {{.*}}) use_device_addr(%[[DEV_ADDR_MEMBERS]] -> %[[ARG_0:.*]], %[[DEV_ADDR]] -> %[[ARG_1:.*]] : !fir.llvm_ptr<!fir.ref<i32>>, !fir.ref<!fir.box<!fir.ptr<i32>>>) {
531+
!CHECK: omp.target_data map_entries(%[[MAP]], %[[MAP_MEMBERS]] : {{.*}}) use_device_addr(%[[DEV_ADDR]] -> %[[ARG_0:.*]], %[[DEV_ADDR_MEMBERS]] -> %[[ARG_1:.*]] : !fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.llvm_ptr<!fir.ref<i32>>) {
532532
!$omp target data map(tofrom: a) use_device_addr(a)
533-
!CHECK: %[[VAL_1_DECL:.*]]:2 = hlfir.declare %[[ARG_1]] {fortran_attrs = #fir.var_attrs<pointer>, uniq_name = "_QFomp_target_device_addrEa"} : (!fir.ref<!fir.box<!fir.ptr<i32>>>) -> (!fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.ref<!fir.box<!fir.ptr<i32>>>)
533+
!CHECK: %[[VAL_1_DECL:.*]]:2 = hlfir.declare %[[ARG_0]] {fortran_attrs = #fir.var_attrs<pointer>, uniq_name = "_QFomp_target_device_addrEa"} : (!fir.ref<!fir.box<!fir.ptr<i32>>>) -> (!fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.ref<!fir.box<!fir.ptr<i32>>>)
534534
!CHECK: %[[C10:.*]] = arith.constant 10 : i32
535535
!CHECK: %[[A_BOX:.*]] = fir.load %[[VAL_1_DECL]]#0 : !fir.ref<!fir.box<!fir.ptr<i32>>>
536536
!CHECK: %[[A_ADDR:.*]] = fir.box_addr %[[A_BOX]] : (!fir.box<!fir.ptr<i32>>) -> !fir.ptr<i32>

flang/test/Lower/OpenMP/use-device-ptr-to-use-device-addr.f90

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
! use_device_ptr to use_device_addr works, without breaking any functionality.
77

88
!CHECK: func.func @{{.*}}only_use_device_ptr()
9-
!CHECK: omp.target_data use_device_addr(%{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}} : !fir.llvm_ptr<!fir.ref<!fir.array<?xf32>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>) use_device_ptr(%{{.*}} -> %{{.*}} : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) {
9+
10+
!CHECK: omp.target_data use_device_addr(%{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}} : !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xf32>>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>) use_device_ptr(%{{.*}} -> %{{.*}} : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) {
1011
subroutine only_use_device_ptr
1112
use iso_c_binding
1213
integer, pointer, dimension(:) :: array
@@ -18,7 +19,7 @@ subroutine only_use_device_ptr
1819
end subroutine
1920

2021
!CHECK: func.func @{{.*}}mix_use_device_ptr_and_addr()
21-
!CHECK: omp.target_data use_device_addr(%{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}} : !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xf32>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>) use_device_ptr({{.*}} : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) {
22+
!CHECK: omp.target_data use_device_addr(%{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}} : !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xf32>>>) use_device_ptr({{.*}} : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) {
2223
subroutine mix_use_device_ptr_and_addr
2324
use iso_c_binding
2425
integer, pointer, dimension(:) :: array
@@ -30,7 +31,7 @@ subroutine mix_use_device_ptr_and_addr
3031
end subroutine
3132

3233
!CHECK: func.func @{{.*}}only_use_device_addr()
33-
!CHECK: omp.target_data use_device_addr(%{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}} : !fir.llvm_ptr<!fir.ref<!fir.array<?xf32>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>, !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>) {
34+
!CHECK: omp.target_data use_device_addr(%{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}} : !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>, !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xf32>>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>) {
3435
subroutine only_use_device_addr
3536
use iso_c_binding
3637
integer, pointer, dimension(:) :: array
@@ -42,7 +43,7 @@ subroutine only_use_device_addr
4243
end subroutine
4344

4445
!CHECK: func.func @{{.*}}mix_use_device_ptr_and_addr_and_map()
45-
!CHECK: omp.target_data map_entries(%{{.*}}, %{{.*}} : !fir.ref<i32>, !fir.ref<i32>) use_device_addr(%{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}} : !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xf32>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>) use_device_ptr(%{{.*}} : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) {
46+
!CHECK: omp.target_data map_entries(%{{.*}}, %{{.*}} : !fir.ref<i32>, !fir.ref<i32>) use_device_addr(%{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}}, %{{.*}} -> %{{.*}} : !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xf32>>>) use_device_ptr(%{{.*}} : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) {
4647
subroutine mix_use_device_ptr_and_addr_and_map
4748
use iso_c_binding
4849
integer :: i, j
@@ -55,7 +56,7 @@ subroutine mix_use_device_ptr_and_addr_and_map
5556
end subroutine
5657

5758
!CHECK: func.func @{{.*}}only_use_map()
58-
!CHECK: omp.target_data map_entries(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}} : !fir.llvm_ptr<!fir.ref<!fir.array<?xf32>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>, !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>) {
59+
!CHECK: omp.target_data map_entries(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}} : !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>, !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xf32>>>, !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>) {
5960
subroutine only_use_map
6061
use iso_c_binding
6162
integer, pointer, dimension(:) :: array

flang/test/Transforms/omp-map-info-finalization.fir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module attributes {omp.is_target_device = false} {
3939
// CHECK: %[[BASE_ADDR_OFF_2:.*]] = fir.box_offset %[[ALLOCA]] base_addr : (!fir.ref<!fir.box<!fir.array<?xi32>>>) -> !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>
4040
// CHECK: %[[DESC_MEMBER_MAP_2:.*]] = omp.map.info var_ptr(%[[ALLOCA]] : !fir.ref<!fir.box<!fir.array<?xi32>>>, !fir.array<?xi32>) var_ptr_ptr(%[[BASE_ADDR_OFF_2]] : !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>) map_clauses(from) capture(ByRef) bounds(%[[BOUNDS]]) -> !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>> {name = ""}
4141
// CHECK: %[[DESC_PARENT_MAP_2:.*]] = omp.map.info var_ptr(%[[ALLOCA]] : !fir.ref<!fir.box<!fir.array<?xi32>>>, !fir.box<!fir.array<?xi32>>) map_clauses(from) capture(ByRef) members(%[[DESC_MEMBER_MAP_2]] : [0] : !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>) -> !fir.ref<!fir.array<?xi32>>
42-
// CHECK: omp.target map_entries(%[[DESC_MEMBER_MAP]] -> %[[ARG1:.*]], %[[DESC_PARENT_MAP]] -> %[[ARG2:.*]], %[[DESC_MEMBER_MAP_2]] -> %[[ARG3:.*]], %[[DESC_PARENT_MAP_2]] -> %[[ARG4:.*]] : {{.*}}) {
42+
// CHECK: omp.target map_entries(%[[DESC_PARENT_MAP]] -> %[[ARG1:.*]], %[[DESC_PARENT_MAP_2]] -> %[[ARG2:.*]], %[[DESC_MEMBER_MAP]] -> %[[ARG3:.*]], %[[DESC_MEMBER_MAP_2]] -> %[[ARG4:.*]] : {{.*}}) {
4343

4444
// -----
4545

0 commit comments

Comments
 (0)