[flang-commits] [flang] [llvm] [Flang][OpenMP] Support nested derived types in DO CONCURRENT device conversion (PR #218963)

via flang-commits flang-commits at lists.llvm.org
Sat Sep 5 09:58:41 PDT 2026


================
@@ -596,34 +596,17 @@ class DoConcurrentConversion
     llvm::SmallVector<mlir::Value> boundsOps;
     genBoundsOps(builder, liveIn, rawAddr, boundsOps);
 
-    auto asRecordType = [&](mlir::Type eleType) {
-      return mlir::dyn_cast<fir::RecordType>(
-          fir::getDerivedType(fir::unwrapRefType(eleType)));
-    };
-
-    fir::RecordType recordType = asRecordType(eleType);
-
-    bool requiresImplcitMapper = [&]() {
-      if (!recordType)
-        return false;
-
-      for (auto [fieldName, fieldType] : recordType.getTypeList()) {
-        if (fir::isAllocatableType(fieldType))
-          return true;
+    fir::RecordType recordType = mlir::dyn_cast<fir::RecordType>(
+        fir::getDerivedType(fir::unwrapRefType(eleType)));
 
-        if (asRecordType(fieldType))
-          TODO(liveIn.getLoc(), "Nested record types are not supported yet.");
-      }
-
-      return false;
-    }();
+    bool requiresImplcitMapper =
+        recordType && fir::isRecordWithAllocatableMember(recordType);
 
     mlir::FlatSymbolRefAttr mapperId;
     if (requiresImplcitMapper) {
       std::string mapperIdName =
           Fortran::utils::openmp::getCanonicalDefaultDeclareMapperName(
----------------
MattPD wrote:

Thanks, the revised PR body makes the current limitation clear. Keeping visible mapper resolution in a focused follow-up after this lands sounds good.


https://github.com/llvm/llvm-project/pull/218963


More information about the flang-commits mailing list