[flang-commits] [flang] [flang] AliasAnalysis: Handle fir.load on fir.alloca (PR #117785)
Renaud Kauffmann via flang-commits
flang-commits at lists.llvm.org
Tue Feb 4 15:32:21 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:
OK. I was given a few days to go deeper into this. I am not sure I agree with your conclusion on T3 but T4 is an issue.
T4 is a new test, so not a regression but would be if added before these changes. And that's what I am trying to say. These changes could really be broken up into separate PRs. It would help considerably with this review.
Also, as I am looking into this more, would you like us to considering `fir.alloca !fir.ptr<T>` as non-data and `!fir.ptr<T>` as data?
https://github.com/llvm/llvm-project/pull/117785
More information about the flang-commits
mailing list