[flang-commits] [flang] [flang] TBAA for memory accesses of derived type values. (PR #68047)

via flang-commits flang-commits at lists.llvm.org
Tue Oct 3 00:22:31 PDT 2023


================
@@ -360,6 +360,17 @@ bool isRecordWithAllocatableMember(mlir::Type ty) {
   return false;
 }
 
+bool isRecordWithDescriptorMember(mlir::Type ty) {
+  if (auto recTy = ty.dyn_cast<fir::RecordType>())
+    for (auto [field, memTy] : recTy.getTypeList()) {
+      if (mlir::isa<fir::BaseBoxType>(memTy))
+        return true;
+      if (memTy.isa<fir::RecordType>() && isRecordWithDescriptorMember(memTy))
----------------
jeanPerier wrote:

Could also be a fir.array<fir.type<... {fir.box}>>, so you should likely unwrap any SequenceType here.

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


More information about the flang-commits mailing list