@@ -60,18 +60,18 @@ struct AliasAnalysis {
6060 // module top
6161 // real, pointer :: a(:)
6262 // end module
63- //
63+ //
6464 // subroutine test()
6565 // use top
6666 // a(1) = 1
6767 // end subroutine
6868 // -------------------------------------------------
69- //
69+ //
7070 // flang -fc1 -emit-fir test.f90 -o test.fir
7171 //
7272 // ------------------- test.fir --------------------
73- // fir.global @_QMtopEa : !fir.box<!fir.ptr<!fir.array<?xf32>>>
74- //
73+ // fir.global @_QMtopEa : !fir.box<!fir.ptr<!fir.array<?xf32>>>
74+ //
7575 // func.func @_QPtest() {
7676 // %c1 = arith.constant 1 : index
7777 // %cst = arith.constant 1.000000e+00 : f32
@@ -100,12 +100,12 @@ struct AliasAnalysis {
100100 // Additionally, because it is relied on in HLFIR lowering, we allow querying
101101 // on a box SSA value, which is interpreted as querying on its data.
102102 //
103- // So in the above example, !fir.ref<f32> and !fir.box<!fir.ptr<!fir.array<?xf32>>> is data,
103+ // So in the above example, !fir.ref<f32> and !fir.box<!fir.ptr<!fir.array<?xf32>>> is data,
104104 // while !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>> is not data.
105105
106106 // This also applies to function arguments. In the example below, %arg0
107107 // is data, %arg1 is not data but a load of %arg1 is.
108- //
108+ //
109109 // func.func @_QFPtest2(%arg0: !fir.ref<f32>, %arg1: !fir.ref<!fir.box<!fir.ptr<f32>>> ) {
110110 // %0 = fir.load %arg1 : !fir.ref<!fir.box<!fir.ptr<f32>>>
111111 // ... }
@@ -183,6 +183,10 @@ struct AliasAnalysis {
183183 friend llvm::raw_ostream &operator <<(llvm::raw_ostream &os,
184184 const AliasAnalysis::Source &op);
185185
186+ // / Given the values and their sources, return their aliasing behavior.
187+ mlir::AliasResult alias (Source lhsSrc, Source rhsSrc, mlir::Value lhs,
188+ mlir::Value rhs);
189+
186190 // / Given two values, return their aliasing behavior.
187191 mlir::AliasResult alias (mlir::Value lhs, mlir::Value rhs);
188192
@@ -193,7 +197,8 @@ struct AliasAnalysis {
193197 // / If getInstantiationPoint is true, the search for the source
194198 // / will stop at [hl]fir.declare if it represents a dummy
195199 // / argument declaration (i.e. it has the dummy_scope operand).
196- Source getSource (mlir::Value, bool getInstantiationPoint = false );
200+ fir::AliasAnalysis::Source getSource (mlir::Value,
201+ bool getInstantiationPoint = false );
197202
198203private:
199204 // / Return true, if `ty` is a reference type to an object of derived type
0 commit comments