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

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Tue Oct 3 10:34:40 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))
----------------
vzakhari wrote:

Good catch! Thank you, Jean!

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


More information about the flang-commits mailing list