[flang-commits] [flang] [flang] AliasAnalysis: More formally define and distinguish between data and non-data (PR #91020)

Joel E. Denny via flang-commits flang-commits at lists.llvm.org
Mon May 6 12:57:07 PDT 2024


================
@@ -54,8 +50,16 @@ struct AliasAnalysis {
     using SourceUnion = llvm::PointerUnion<mlir::SymbolRefAttr, mlir::Value>;
     using Attributes = Fortran::common::EnumSet<Attribute, Attribute_enumSize>;
 
-    /// Source definition of a value.
-    SourceUnion u;
+    struct SourceOrigin {
+      /// Source definition of a value.
+      SourceUnion u;
+
+      /// Whether the source was reached following data or box reference
----------------
jdenny-ornl wrote:

Agreed.  The RFC examples and discussion make it clearer to me that `isData` is specifically defined as something like `!isBoxRef`.  For example, even without the above comment, it's somewhat intuitive to me that `!fir.ref<f32>` and `!fir.box<!fir.ptr<!fir.array<?xf32>>>` (cases from the RFC) should have `isBoxRef=false`, but the above comment alone does not make it clear to me that they should have `isData=true`.

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


More information about the flang-commits mailing list