[flang-commits] [flang] [flang] Restructured TBAA trees in AddAliasTags pass. (PR #136725)

via flang-commits flang-commits at lists.llvm.org
Wed Apr 23 04:52:25 PDT 2025


================
@@ -0,0 +1,331 @@
+// RUN: fir-opt --fir-add-alias-tags %s | FileCheck --check-prefixes=ALL,DEFAULT %s
+// RUN: fir-opt --fir-add-alias-tags --local-alloc-tbaa %s | FileCheck --check-prefixes=ALL,LOCAL %s
+
+// Test AddAliasTagsPass creating sub-tree for TARGET/POINTER variables.
+
+// module data
+//   real :: glob(10)
+//   real, target :: globt(10)
+//   real, allocatable :: globa(:)
+//   real, allocatable, target :: globat(:)
+//   real, pointer :: globp(:)
+// end module data
+// subroutine test1(dummyf, dummyft, dummyas, dummyast, dummya, dummyat, dummyp)
+//   use data
+//   real :: dummyf(10)
+//   real, target :: dummyft(10)
+//   real :: dummyas(:)
+//   real, target :: dummyast(:)
+//   real, allocatable :: dummya(:)
+//   real, allocatable, target :: dummyat(:)
+//   real, pointer :: dummyp(:)
+//   real :: local(10)
+//   real, target :: localt(10)
+//   real, allocatable :: locala(:)
+//   real, allocatable, target :: localat(:)
+//   real, pointer :: localp(:)
+//   glob(1) = 1.0
+//   globt(1) = 1.0
+//   globa(1) = 1.0
+//   globat(1) = 1.0
+//   globp(1) = 1.0
+//   dummyf(1) = 1.0
+//   dummyft(1) = 1.0
+//   dummyas(1) = 1.0
+//   dummyast(1) = 1.0
+//   dummya(1) = 1.0
+//   dummyat(1) = 1.0
+//   dummyp(1) = 1.0
+//   local(1) = 1.0
+//   localt(1) = 1.0
+//   locala(1) = 1.0
+//   localat(1) = 1.0
+//   localp(1) = 1.0
+// end subroutine test1
+
+// "Flang function root _QPtest1"
+// |
+// "any access"
+// |
+// |- "descriptor member"
+// |- "any data access"
+//    |
+//    |- "dummy arg data"
+//    |  |
+//    |  |- "dummy arg data/_QFtest1Edummyf"
+//    |  |- "dummy arg data/_QFtest1Edummyas"
+//    |  |- "dummy arg data/_QFtest1Edummya"
+//    |
+//    |- "target data" <- all pointers and taget dummys
+//       |
+//       |- "global data"
+//       |  |
+//       |  |- "global data/_QMdataEglob"
+//       |  |- "global data/_QMdataEglobt"
+//       |
+//       |- "direct data" - "direct data/_QMdataEgloba"
----------------
jeanPerier wrote:

nit: extra ` - "direct data/_QMdataEgloba"`?

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


More information about the flang-commits mailing list