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

via flang-commits flang-commits at lists.llvm.org
Mon May 6 07:53:51 PDT 2024


================
@@ -258,7 +266,10 @@ AliasAnalysis::Source AliasAnalysis::getSource(mlir::Value v) {
   mlir::Type ty;
   bool breakFromLoop{false};
   bool approximateSource{false};
-  bool followBoxAddr{mlir::isa<fir::BaseBoxType>(v.getType())};
+  bool followBoxData{mlir::isa<fir::BaseBoxType>(v.getType())};
+  bool isBoxRef{fir::isa_ref_type(v.getType()) &&
+                mlir::isa<fir::BaseBoxType>(fir::unwrapRefType(v.getType()))};
+  bool followingData = !isBoxRef || followBoxData;
----------------
jeanPerier wrote:

Since `isBoxRef` and `followBoxData` cannot be both true at that point, I think `followingData` initial value can simply be `!isBoxRef`.

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


More information about the flang-commits mailing list