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

Renaud Kauffmann via flang-commits flang-commits at lists.llvm.org
Thu Feb 6 12:18:41 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);
----------------
Renaud-K wrote:

After my changes, C1 to C3 will probably look very different. It will not make sense to discuss them.
Could be best to start a new PR.

As far as discussing T3. You should be driving the discussion maybe even file an issue. But because of the time spent, my management is now asking for benchmark data so be ready for that.

The 80+ other original tests look good. We can move forward with them. But this should just be a matter of generalizing what we are doing in the box load since, from what I could tell, it is what is limiting these tests. We do need to change our definition of data vs non-data for them.


 

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


More information about the flang-commits mailing list