Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions flang/lib/Lower/OpenMP/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,16 +362,18 @@ mlir::Value createParentSymAndGenIntermediateMaps(
clauseLocation, firOpBuilder.getRefType(memberTy), curValue,
llvm::SmallVector<fir::IntOrValue, 1>{idxConst});

// Skip mapping and the subsequent load if we're the final member or not
// a type with a descriptor such as a pointer/allocatable. If we're a
// final member, the map will be generated by the processMap call that
// invoked this function, and if we're not a type with a descriptor then
// we have no need of generating an intermediate map for it, as we only
// need to generate a map if a member is a descriptor type (and thus
// obscures the members it contains via a pointer in which it's data needs
// mapped)
if ((currentIndicesIdx == indices.size() - 1) ||
!fir::isTypeWithDescriptor(memberTy)) {
// If we're a final member, the map will be generated by the processMap
// call that invoked this function.
if (currentIndicesIdx == indices.size() - 1)
break;

// Skip mapping and the subsequent load if we're not
// a type with a descriptor such as a pointer/allocatable. If we're not a
// type with a descriptor then we have no need of generating an
// intermediate map for it, as we only need to generate a map if a member
// is a descriptor type (and thus obscures the members it contains via a
// pointer in which it's data needs mapped).
if (!fir::isTypeWithDescriptor(memberTy)) {
currentIndicesIdx++;
continue;
}
Expand Down
Loading