[flang-commits] [flang] [flang] AliasAnalysis: Handle fir.load on fir.alloca (PR #117785)

Joel E. Denny via flang-commits flang-commits at lists.llvm.org
Wed Feb 12 11:51:59 PST 2025


================
@@ -522,6 +546,12 @@ AliasAnalysis::Source AliasAnalysis::getSource(mlir::Value v,
         .Case<fir::AllocaOp, fir::AllocMemOp>([&](auto op) {
           // Unique memory allocation.
           type = SourceKind::Allocate;
+          // If there's no DeclareOp, then we need to get the pointer attribute
+          // from the type.  TODO: That case occurs in our test suite
+          // (alias-analysis-2.fir), but does flang currently generate such
+          // code?
+          if (isPointerReference(ty))
+            attributes.set(Attribute::Pointer);
----------------
jdenny-ornl wrote:

Thanks to PR #126156, the main change in this PR no longer appears to affect `fir.alloca !fir.ptr<T>` and `!fir.ref<!fir.ptr<T>>`.  Thus, C1+C2 or C3 is no longer needed to avoid breaking T1 and T2, which are no longer interesting and don't need to be marked in the test suite. Finally, @Renaud-K copied this PR's T3 and T4 to his PR #125917.

I'm resolving this and related conversations so we can focus on the rest of this PR.

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


More information about the flang-commits mailing list