[flang-commits] [flang] [flang] Stop tracking memory source after a load in a more explicit manner. (PR #126156)

Joel E. Denny via flang-commits flang-commits at lists.llvm.org
Fri Feb 7 10:28:29 PST 2025


================
@@ -600,6 +590,40 @@ AliasAnalysis::Source AliasAnalysis::getSource(mlir::Value v,
             defOp = v.getDefiningOp();
             return;
           }
+
+          // If we are loading a box reference, but following the data,
+          // we gather the attributes of the box to populate the source
+          // and stop tracking.
+          if (auto boxTy = mlir::dyn_cast<fir::BaseBoxType>(ty);
+              boxTy && followingData) {
----------------
jdenny-ornl wrote:

Is a goal of this new condition to ensure cases like `fir.alloca !fir.ptr<T>` and `!fir.ref<!fir.ptr<T>>` will never be handled by this code?  Thus, T3 and T4 will stay MayAlias, even after we extend this for alloca?  If so, that works for my current use cases.

For now (before we extend for alloca), is this PR intended to be NFC?

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


More information about the flang-commits mailing list