Skip to content

Commit 8819ac0

Browse files
committed
[Flang][OpenMP] Align map clause generation and fix issue with non-shared allocations for assumed shape/size descriptor types
This PR aims to unify the map argument generation behavior across both the implicit capture (captured in a target region) and the explicit capture (process map), currently the varPtr field of the MapInfo for the same variable will be different depending on how it's captured. This PR tries to align that across the generations of MapInfoOp in the OpenMP lowering. Currently, I have opted to utilise the rawInput (input memref to a HLFIR DeclareInfoOp) as opposed to the addr field which includes more information. The side affect of this is that we have to deal with BoxTypes less often, which will result in simpler maps in these cases. The negative side affect of this is that we don't have access to the bounds information through the resulting value, however, I believe the bounds information we require in our case is still appropriately stored in the map bounds, and this seems to be the case from testing so far. The other fix is for cases where we end up with a BoxType argument into a function (certain assumed shape and sizes cases do this) that has no fir.ref wrapping it. As we need the Box to be a reference type to actually utilise the operation to access the base address stored inside and create the correct mappings we currently generate an intermediate allocation in these cases, and then store into it, and utilise this as the map argument, as opposed to the original. However, as we were not sharing the same intermediate allocation across all of the maps for a variable, this resulted in errors in certain cases when detatching/attatching the data e.g. via enter and exit. This PR adjusts this for cases Currently we only maintain tracking of all intermediate allocations for the current function scope, as opposed to module. Primarily as the only case I am aware of that this is required is in cases where we pass certain types of arguments to functions (so I opted to minimize the overhead of the pass for now). It could likely be extended to module scope if required if we find other cases where it's applicable and causing issues.
1 parent 788731c commit 8819ac0

File tree

9 files changed

+83
-66
lines changed

9 files changed

+83
-66
lines changed

flang/include/flang/Optimizer/Transforms/Passes.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,11 @@ def LoopVersioning : Pass<"loop-versioning", "mlir::func::FuncOp"> {
341341
}
342342

343343
def OMPMapInfoFinalizationPass
344-
: Pass<"omp-map-info-finalization"> {
344+
: Pass<"omp-map-info-finalization", "mlir::func::FuncOp"> {
345345
let summary = "expands OpenMP MapInfo operations containing descriptors";
346346
let description = [{
347-
Expands MapInfo operations containing descriptor types into multiple
348-
MapInfo's for each pointer element in the descriptor that requires
347+
Expands MapInfo operations containing descriptor types into multiple
348+
MapInfo's for each pointer element in the descriptor that requires
349349
explicit individual mapping by the OpenMP runtime.
350350
}];
351351
let dependentDialects = ["mlir::omp::OpenMPDialect"];

flang/lib/Lower/OpenMP/ClauseProcessor.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -970,25 +970,21 @@ bool ClauseProcessor::processMap(
970970
object.ref(), clauseLocation, asFortran, bounds,
971971
treatIndexAsSection);
972972

973-
auto origSymbol = converter.getSymbolAddress(*object.sym());
974-
mlir::Value symAddr = info.addr;
975-
if (origSymbol && fir::isTypeWithDescriptor(origSymbol.getType()))
976-
symAddr = origSymbol;
977-
978973
// Explicit map captures are captured ByRef by default,
979974
// optimisation passes may alter this to ByCopy or other capture
980975
// types to optimise
976+
mlir::Value baseOp = info.rawInput;
981977
auto location = mlir::NameLoc::get(
982978
mlir::StringAttr::get(firOpBuilder.getContext(), asFortran.str()),
983-
symAddr.getLoc());
979+
baseOp.getLoc());
984980
mlir::omp::MapInfoOp mapOp = createMapInfoOp(
985-
firOpBuilder, location, symAddr,
981+
firOpBuilder, location, baseOp,
986982
/*varPtrPtr=*/mlir::Value{}, asFortran.str(), bounds,
987983
/*members=*/{}, /*membersIndex=*/mlir::DenseIntElementsAttr{},
988984
static_cast<
989985
std::underlying_type_t<llvm::omp::OpenMPOffloadMappingFlags>>(
990986
mapTypeBits),
991-
mlir::omp::VariableCaptureKind::ByRef, symAddr.getType());
987+
mlir::omp::VariableCaptureKind::ByRef, baseOp.getType());
992988

993989
if (object.sym()->owner().IsDerivedType()) {
994990
addChildIndexAndMapToParent(object, parentMemberIndices, mapOp,
@@ -997,9 +993,9 @@ bool ClauseProcessor::processMap(
997993
result.mapVars.push_back(mapOp);
998994
ptrMapSyms->push_back(object.sym());
999995
if (mapSymTypes)
1000-
mapSymTypes->push_back(symAddr.getType());
996+
mapSymTypes->push_back(baseOp.getType());
1001997
if (mapSymLocs)
1002-
mapSymLocs->push_back(symAddr.getLoc());
998+
mapSymLocs->push_back(baseOp.getLoc());
1003999
}
10041000
}
10051001
});

flang/lib/Lower/OpenMP/ClauseProcessor.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,22 +212,18 @@ bool ClauseProcessor::processMotionClauses(lower::StatementContext &stmtCtx,
212212
object.ref(), clauseLocation, asFortran, bounds,
213213
treatIndexAsSection);
214214

215-
auto origSymbol = converter.getSymbolAddress(*object.sym());
216-
mlir::Value symAddr = info.addr;
217-
if (origSymbol && fir::isTypeWithDescriptor(origSymbol.getType()))
218-
symAddr = origSymbol;
219-
220215
// Explicit map captures are captured ByRef by default,
221216
// optimisation passes may alter this to ByCopy or other capture
222217
// types to optimise
218+
mlir::Value baseOp = info.rawInput;
223219
mlir::omp::MapInfoOp mapOp = createMapInfoOp(
224-
firOpBuilder, clauseLocation, symAddr,
220+
firOpBuilder, clauseLocation, baseOp,
225221
/*varPtrPtr=*/mlir::Value{}, asFortran.str(), bounds,
226222
/*members=*/{}, /*membersIndex=*/mlir::DenseIntElementsAttr{},
227223
static_cast<
228224
std::underlying_type_t<llvm::omp::OpenMPOffloadMappingFlags>>(
229225
mapTypeBits),
230-
mlir::omp::VariableCaptureKind::ByRef, symAddr.getType());
226+
mlir::omp::VariableCaptureKind::ByRef, baseOp.getType());
231227

232228
if (object.sym()->owner().IsDerivedType()) {
233229
addChildIndexAndMapToParent(object, parentMemberIndices, mapOp,

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,37 +1670,46 @@ genTargetOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
16701670
if (dsp.getAllSymbolsToPrivatize().contains(&sym))
16711671
return;
16721672

1673+
// Structure component symbols don't have bindings, and can only be
1674+
// explicitly mapped individually. If a member is captured implicitly
1675+
// we map the entirety of the derived type when we find its symbol.
1676+
if (sym.owner().IsDerivedType())
1677+
return;
1678+
16731679
// if the symbol is part of an already mapped common block, do not make a
16741680
// map for it.
16751681
if (const Fortran::semantics::Symbol *common =
16761682
Fortran::semantics::FindCommonBlockContaining(sym.GetUltimate()))
16771683
if (llvm::find(mapSyms, common) != mapSyms.end())
16781684
return;
16791685

1680-
if (llvm::find(mapSyms, &sym) == mapSyms.end()) {
1681-
mlir::Value baseOp = converter.getSymbolAddress(sym);
1682-
if (!baseOp)
1683-
if (const auto *details =
1684-
sym.template detailsIf<semantics::HostAssocDetails>()) {
1685-
baseOp = converter.getSymbolAddress(details->symbol());
1686-
converter.copySymbolBinding(details->symbol(), sym);
1687-
}
1686+
// If we come across a symbol without a symbol address, we
1687+
// return as we cannot process it, this is intended as a
1688+
// catch all early exit for symbols that do not have a
1689+
// corresponding extended value. Such as subroutines,
1690+
// interfaces and named blocks.
1691+
if (!converter.getSymbolAddress(sym))
1692+
return;
16881693

1689-
if (baseOp) {
1694+
if (llvm::find(mapSyms, &sym) == mapSyms.end()) {
1695+
if (const auto *details =
1696+
sym.template detailsIf<semantics::HostAssocDetails>())
1697+
converter.copySymbolBinding(details->symbol(), sym);
16901698
llvm::SmallVector<mlir::Value> bounds;
16911699
std::stringstream name;
16921700
fir::ExtendedValue dataExv = converter.getSymbolExtendedValue(sym);
16931701
name << sym.name().ToString();
16941702

16951703
lower::AddrAndBoundsInfo info = getDataOperandBaseAddr(
16961704
converter, firOpBuilder, sym, converter.getCurrentLocation());
1705+
mlir::Value baseOp = info.rawInput;
16971706
if (mlir::isa<fir::BaseBoxType>(
1698-
fir::unwrapRefType(info.addr.getType())))
1707+
fir::unwrapRefType(baseOp.getType())))
16991708
bounds = lower::genBoundsOpsFromBox<mlir::omp::MapBoundsOp,
17001709
mlir::omp::MapBoundsType>(
17011710
firOpBuilder, converter.getCurrentLocation(), dataExv, info);
17021711
if (mlir::isa<fir::SequenceType>(
1703-
fir::unwrapRefType(info.addr.getType()))) {
1712+
fir::unwrapRefType(baseOp.getType()))) {
17041713
bool dataExvIsAssumedSize =
17051714
semantics::IsAssumedSizeArray(sym.GetUltimate());
17061715
bounds = lower::genBaseBoundsOps<mlir::omp::MapBoundsOp,
@@ -1755,7 +1764,6 @@ genTargetOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
17551764
mapSyms.push_back(&sym);
17561765
mapLocs.push_back(baseOp.getLoc());
17571766
mapTypes.push_back(baseOp.getType());
1758-
}
17591767
}
17601768
};
17611769
lower::pft::visitAllSymbols(eval, captureImplicitMap);

flang/lib/Optimizer/Transforms/OMPMapInfoFinalization.cpp

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ class OMPMapInfoFinalizationPass
5151
: public fir::impl::OMPMapInfoFinalizationPassBase<
5252
OMPMapInfoFinalizationPass> {
5353

54+
/// Tracks any intermediate function/subroutine local allocations we
55+
/// generate for the descriptors of box type dummy arguments, so that
56+
/// we can retrieve it for subsequent reuses within the functions
57+
/// scope
58+
std::map</*descriptor opaque pointer=*/ void *,
59+
/*corresponding local alloca=*/ fir::AllocaOp>
60+
localBoxAllocas;
61+
62+
5463
void genDescriptorMemberMaps(mlir::omp::MapInfoOp op,
5564
fir::FirOpBuilder &builder,
5665
mlir::Operation *target) {
@@ -75,14 +84,26 @@ class OMPMapInfoFinalizationPass
7584
// perform an alloca and then store to it and retrieve the data from the new
7685
// alloca.
7786
if (mlir::isa<fir::BaseBoxType>(descriptor.getType())) {
78-
mlir::OpBuilder::InsertPoint insPt = builder.saveInsertionPoint();
79-
mlir::Block *allocaBlock = builder.getAllocaBlock();
80-
assert(allocaBlock && "No alloca block found for this top level op");
81-
builder.setInsertionPointToStart(allocaBlock);
82-
auto alloca = builder.create<fir::AllocaOp>(loc, descriptor.getType());
83-
builder.restoreInsertionPoint(insPt);
84-
builder.create<fir::StoreOp>(loc, descriptor, alloca);
85-
descriptor = alloca;
87+
// if we have already created a local allocation for this BoxType,
88+
// we must be sure to re-use it so that we end up with the same
89+
// allocations being utilised for the same descriptor across all map uses,
90+
// this prevents runtime issues such as not appropriately releasing or
91+
// deleting all mapped data.
92+
auto find = localBoxAllocas.find(descriptor.getAsOpaquePointer());
93+
if (find != localBoxAllocas.end()) {
94+
builder.create<fir::StoreOp>(loc, descriptor, find->second);
95+
descriptor = find->second;
96+
} else {
97+
mlir::OpBuilder::InsertPoint insPt = builder.saveInsertionPoint();
98+
mlir::Block *allocaBlock = builder.getAllocaBlock();
99+
assert(allocaBlock && "No alloca block found for this top level op");
100+
builder.setInsertionPointToStart(allocaBlock);
101+
auto alloca = builder.create<fir::AllocaOp>(loc, descriptor.getType());
102+
builder.restoreInsertionPoint(insPt);
103+
builder.create<fir::StoreOp>(loc, descriptor, alloca);
104+
localBoxAllocas[descriptor.getAsOpaquePointer()] = alloca;
105+
descriptor = alloca;
106+
}
86107
}
87108

88109
mlir::Value baseAddrAddr = builder.create<fir::BoxOffsetOp>(
@@ -228,14 +249,12 @@ class OMPMapInfoFinalizationPass
228249
// operation (usually function) containing the MapInfoOp because this pass
229250
// will mutate siblings of MapInfoOp.
230251
void runOnOperation() override {
231-
mlir::ModuleOp module =
232-
mlir::dyn_cast_or_null<mlir::ModuleOp>(getOperation());
233-
if (!module)
234-
module = getOperation()->getParentOfType<mlir::ModuleOp>();
252+
mlir::func::FuncOp func = getOperation();
253+
mlir::ModuleOp module = func->getParentOfType<mlir::ModuleOp>();
235254
fir::KindMapping kindMap = fir::getKindMapping(module);
236255
fir::FirOpBuilder builder{module, std::move(kindMap)};
237256

238-
getOperation()->walk([&](mlir::omp::MapInfoOp op) {
257+
func->walk([&](mlir::omp::MapInfoOp op) {
239258
// TODO: Currently only supports a single user for the MapInfoOp, this
240259
// is fine for the moment as the Fortran Frontend will generate a
241260
// new MapInfoOp per Target operation for the moment. However, when/if

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
!HOST: %[[C2:.*]] = arith.constant 1 : index
1616
!HOST: %[[C3:.*]] = arith.constant 4 : index
1717
!HOST: %[[BOUNDS0:.*]] = omp.map.bounds lower_bound(%[[C2]] : index) upper_bound(%[[C3]] : index) extent(%[[C10]] : index) stride(%[[C1]] : index) start_idx(%[[C1]] : index)
18-
!HOST: %[[MAP0:.*]] = omp.map.info var_ptr(%[[READ_DECL]]#0 : !fir.ref<!fir.array<10xi32>>, !fir.array<10xi32>) map_clauses(tofrom) capture(ByRef) bounds(%[[BOUNDS0]]) -> !fir.ref<!fir.array<10xi32>> {name = "sp_read(2:5)"}
18+
!HOST: %[[MAP0:.*]] = omp.map.info var_ptr(%[[READ_DECL]]#1 : !fir.ref<!fir.array<10xi32>>, !fir.array<10xi32>) map_clauses(tofrom) capture(ByRef) bounds(%[[BOUNDS0]]) -> !fir.ref<!fir.array<10xi32>> {name = "sp_read(2:5)"}
1919
!HOST: %[[C4:.*]] = arith.constant 1 : index
2020
!HOST: %[[C5:.*]] = arith.constant 1 : index
2121
!HOST: %[[C6:.*]] = arith.constant 4 : index
2222
!HOST: %[[BOUNDS1:.*]] = omp.map.bounds lower_bound(%[[C5]] : index) upper_bound(%[[C6]] : index) extent(%[[C10_0]] : index) stride(%[[C4]] : index) start_idx(%[[C4]] : index)
23-
!HOST: %[[MAP1:.*]] = omp.map.info var_ptr(%[[WRITE_DECL]]#0 : !fir.ref<!fir.array<10xi32>>, !fir.array<10xi32>) map_clauses(tofrom) capture(ByRef) bounds(%[[BOUNDS1]]) -> !fir.ref<!fir.array<10xi32>> {name = "sp_write(2:5)"}
23+
!HOST: %[[MAP1:.*]] = omp.map.info var_ptr(%[[WRITE_DECL]]#1 : !fir.ref<!fir.array<10xi32>>, !fir.array<10xi32>) map_clauses(tofrom) capture(ByRef) bounds(%[[BOUNDS1]]) -> !fir.ref<!fir.array<10xi32>> {name = "sp_write(2:5)"}
2424
!HOST: omp.target map_entries(%[[MAP0]] -> %{{.*}}, %[[MAP1]] -> %{{.*}}, {{.*}} -> {{.*}} : !fir.ref<!fir.array<10xi32>>, !fir.ref<!fir.array<10xi32>>, !fir.ref<i32>) {
2525

2626
subroutine read_write_section()
@@ -65,20 +65,19 @@ subroutine assumed_shape_array(arr_read_write)
6565
end subroutine assumed_shape_array
6666

6767

68+
69+
6870
!HOST-LABEL: func.func @_QMassumed_array_routinesPassumed_size_array(
6971
!HOST-SAME: %[[ARG0:.*]]: !fir.ref<!fir.array<?xi32>> {fir.bindc_name = "arr_read_write"}) {
70-
!HOST: %[[INTERMEDIATE_ALLOCA:.*]] = fir.alloca !fir.box<!fir.array<?xi32>>
7172
!HOST: %[[ARG0_SHAPE:.*]] = fir.shape %{{.*}} : (index) -> !fir.shape<1>
7273
!HOST: %[[ARG0_DECL:.*]]:2 = hlfir.declare %[[ARG0]](%[[ARG0_SHAPE]]) dummy_scope %{{[0-9]+}} {fortran_attrs = #fir.var_attrs<intent_inout>, uniq_name = "_QMassumed_array_routinesFassumed_size_arrayEarr_read_write"} : (!fir.ref<!fir.array<?xi32>>, !fir.shape<1>, !fir.dscope) -> (!fir.box<!fir.array<?xi32>>, !fir.ref<!fir.array<?xi32>>)
7374
!HOST: %[[ALLOCA:.*]] = fir.alloca i32 {bindc_name = "i", uniq_name = "_QMassumed_array_routinesFassumed_size_arrayEi"}
7475
!HOST: %[[DIMS0:.*]]:3 = fir.box_dims %[[ARG0_DECL]]#0, %c0{{.*}} : (!fir.box<!fir.array<?xi32>>, index) -> (index, index, index)
7576
!HOST: %[[C4_1:.*]] = arith.subi %c4, %c1{{.*}} : index
7677
!HOST: %[[EXT:.*]] = arith.addi %[[C4_1]], %c1{{.*}} : index
7778
!HOST: %[[BOUNDS:.*]] = omp.map.bounds lower_bound(%c1{{.*}} : index) upper_bound(%c4{{.*}} : index) extent(%[[EXT]] : index) stride(%[[DIMS0]]#2 : index) start_idx(%c1{{.*}} : index) {stride_in_bytes = true}
78-
!HOST: %[[VAR_PTR_PTR:.*]] = fir.box_offset %[[INTERMEDIATE_ALLOCA]] base_addr : (!fir.ref<!fir.box<!fir.array<?xi32>>>) -> !fir.llvm_ptr<!fir.ref<!fir.array<?xi32>>>
79-
!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 = ""}
80-
!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)"}
81-
!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>) {
79+
!HOST: %[[MAP:.*]] = omp.map.info var_ptr(%[[ARG0_DECL]]#1 : !fir.ref<!fir.array<?xi32>>, !fir.array<?xi32>) map_clauses(tofrom) capture(ByRef) bounds(%[[BOUNDS]]) -> !fir.ref<!fir.array<?xi32>> {name = "arr_read_write(2:5)"}
80+
!HOST: omp.target map_entries(%[[MAP]] -> %{{.*}}, {{.*}} -> {{.*}} : !fir.ref<!fir.array<?xi32>>, !fir.ref<i32>) {
8281
subroutine assumed_size_array(arr_read_write)
8382
integer, intent(inout) :: arr_read_write(*)
8483

flang/test/Lower/OpenMP/common-block-map.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ subroutine map_full_block
4040
!CHECK: %[[COORD:.*]] = fir.coordinate_of %[[CB_CONV]], %[[INDEX]] : (!fir.ref<!fir.array<?xi8>>, index) -> !fir.ref<i8>
4141
!CHECK: %[[CONV:.*]] = fir.convert %[[COORD]] : (!fir.ref<i8>) -> !fir.ref<i32>
4242
!CHECK: %[[CB_MEMBER_2:.*]]:2 = hlfir.declare %[[CONV]] {uniq_name = "_QFmap_mix_of_membersEvar2"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
43-
!CHECK: %[[MAP_EXP:.*]] = omp.map.info var_ptr(%[[CB_MEMBER_2]]#0 : !fir.ref<i32>, i32) map_clauses(tofrom) capture(ByRef) -> !fir.ref<i32> {name = "var2"}
43+
!CHECK: %[[MAP_EXP:.*]] = omp.map.info var_ptr(%[[CB_MEMBER_2]]#1 : !fir.ref<i32>, i32) map_clauses(tofrom) capture(ByRef) -> !fir.ref<i32> {name = "var2"}
4444
!CHECK: %[[MAP_IMP:.*]] = omp.map.info var_ptr(%[[CB_MEMBER_1]]#1 : !fir.ref<i32>, i32) map_clauses(implicit, exit_release_or_enter_alloc) capture(ByCopy) -> !fir.ref<i32> {name = "var1"}
4545
!CHECK: omp.target map_entries(%[[MAP_EXP]] -> %[[ARG_EXP:.*]], %[[MAP_IMP]] -> %[[ARG_IMP:.*]] : !fir.ref<i32>, !fir.ref<i32>) {
4646
!CHECK: ^bb0(%[[ARG_EXP]]: !fir.ref<i32>, %[[ARG_IMP]]: !fir.ref<i32>):

flang/test/Lower/OpenMP/derived-type-map.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ end subroutine mapType_derived_implicit
2121

2222
!CHECK: %[[ALLOCA:.*]] = fir.alloca !fir.type<_QFmaptype_derived_explicitTscalar_and_array{real:f32,array:!fir.array<10xi32>,int:i32}> {bindc_name = "scalar_arr", uniq_name = "_QFmaptype_derived_explicitEscalar_arr"}
2323
!CHECK: %[[DECLARE:.*]]:2 = hlfir.declare %[[ALLOCA]] {uniq_name = "_QFmaptype_derived_explicitEscalar_arr"} : (!fir.ref<!fir.type<_QFmaptype_derived_explicitTscalar_and_array{real:f32,array:!fir.array<10xi32>,int:i32}>>) -> (!fir.ref<!fir.type<_QFmaptype_derived_explicitTscalar_and_array{real:f32,array:!fir.array<10xi32>,int:i32}>>, !fir.ref<!fir.type<_QFmaptype_derived_explicitTscalar_and_array{real:f32,array:!fir.array<10xi32>,int:i32}>>)
24-
!CHECK: %[[MAP:.*]] = omp.map.info var_ptr(%[[DECLARE]]#0 : !fir.ref<!fir.type<_QFmaptype_derived_explicitTscalar_and_array{real:f32,array:!fir.array<10xi32>,int:i32}>>, !fir.type<_QFmaptype_derived_explicitTscalar_and_array{real:f32,array:!fir.array<10xi32>,int:i32}>) map_clauses(tofrom) capture(ByRef) -> !fir.ref<!fir.type<_QFmaptype_derived_explicitTscalar_and_array{real:f32,array:!fir.array<10xi32>,int:i32}>> {name = "scalar_arr"}
24+
!CHECK: %[[MAP:.*]] = omp.map.info var_ptr(%[[DECLARE]]#1 : !fir.ref<!fir.type<_QFmaptype_derived_explicitTscalar_and_array{real:f32,array:!fir.array<10xi32>,int:i32}>>, !fir.type<_QFmaptype_derived_explicitTscalar_and_array{real:f32,array:!fir.array<10xi32>,int:i32}>) map_clauses(tofrom) capture(ByRef) -> !fir.ref<!fir.type<_QFmaptype_derived_explicitTscalar_and_array{real:f32,array:!fir.array<10xi32>,int:i32}>> {name = "scalar_arr"}
2525
!CHECK: omp.target map_entries(%[[MAP]] -> %[[ARG0:.*]] : !fir.ref<!fir.type<_QFmaptype_derived_explicitTscalar_and_array{real:f32,array:!fir.array<10xi32>,int:i32}>>) {
2626
!CHECK: ^bb0(%[[ARG0]]: !fir.ref<!fir.type<_QFmaptype_derived_explicitTscalar_and_array{real:f32,array:!fir.array<10xi32>,int:i32}>>):
2727
subroutine mapType_derived_explicit

0 commit comments

Comments
 (0)