[flang-commits] [flang] [flang] AliasAnalysis: distinguish addr of arg vs. addr in arg (PR #87723)
Renaud Kauffmann via flang-commits
flang-commits at lists.llvm.org
Thu May 2 19:09:40 PDT 2024
================
@@ -399,19 +404,30 @@ AliasAnalysis::Source AliasAnalysis::getSource(mlir::Value v) {
if (!defOp && type == SourceKind::Unknown)
// Check if the memory source is coming through a dummy argument.
if (isDummyArgument(v)) {
- type = SourceKind::Argument;
ty = v.getType();
if (fir::valueHasFirAttribute(v, fir::getTargetAttrName()))
attributes.set(Attribute::Target);
-
if (Source::isPointerReference(ty))
attributes.set(Attribute::Pointer);
+ if (followBoxAddr && fir::isa_ref_type(ty))
----------------
Renaud-K wrote:
Talking to Jean, reminded me that we are already handling the query on a box value as a query on the data.
`bool followBoxAddr{mlir::isa<fir::BaseBoxType>(v.getType())};`
We initialize `followBoxAddr` to true if we are starting from a box.
Though this is a moot point for this discussion since you are interested on a distinction between references.
I am working on a proposal to eliminate SourceKind::Direct while still retaining the information it was capturing. You still will be able to distinguish between data and box. I will write up an RFC tomorrow and will send out a WIP PR.
https://github.com/llvm/llvm-project/pull/87723
More information about the flang-commits
mailing list