@@ -54,9 +54,22 @@ struct AliasAnalysis {
5454 // the use-def chain, to arrive at the same origin, even though the starting
5555 // points were known to not alias.
5656 //
57- // Example:
5857 // clang-format off
59- // fir.global @_QMtopEa : !fir.box<!fir.ptr<!fir.array<?xf32>>>
58+ // Example:
59+ // ------------------- test.f90 --------------------
60+ // module top
61+ // real, pointer :: a(:)
62+ // end module
63+ //
64+ // subroutine test()
65+ // use top
66+ // a(1) = 1
67+ // -------------------------------------------------
68+ //
69+ // flang-new -fc1 -emit-fir test.f90 -o test.fir
70+ //
71+ // ------------------- test.fir --------------------
72+ // fir.global @_QMtopEa : !fir.box<!fir.ptr<!fir.array<?xf32>>>
6073 //
6174 // func.func @_QPtest() {
6275 // %c1 = arith.constant 1 : index
@@ -69,10 +82,11 @@ struct AliasAnalysis {
6982 // fir.store %cst to %5 : !fir.ref<f32>
7083 // return
7184 // }
85+ // -------------------------------------------------
7286 //
7387 // With high level operations, such as fir.array_coor, it is possible to
74- // reach into the data wrapped by the box (the descriptor) therefore when
75- // asking about the memory source of the %5, we are really asking about the
88+ // reach into the data wrapped by the box (the descriptor). Therefore when
89+ // asking about the memory source of %5, we are really asking about the
7690 // source of the data of box %2.
7791 //
7892 // When asking about the source of %0 which is the address of the box, we
@@ -88,7 +102,7 @@ struct AliasAnalysis {
88102 // So in the above example, !fir.ref<f32> and !fir.box<!fir.ptr<!fir.array<?xf32>>> is data,
89103 // while !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>> is not data.
90104
91- // This generally applies to function arguments. In the example below, %arg0
105+ // This also applies to function arguments. In the example below, %arg0
92106 // is data, %arg1 is not data but a load of %arg1 is.
93107 //
94108 // func.func @_QFPtest2(%arg0: !fir.ref<f32>, %arg1: !fir.ref<!fir.box<!fir.ptr<f32>>> ) {
0 commit comments