[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 Apr 4 17:56:35 PDT 2024
================
@@ -399,16 +407,18 @@ 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 && attributes.test(Attribute::Pointer))
----------------
Renaud-K wrote:
It looks good overall. The test change looks correct.
Why do we need this condition : `&& attributes.test(Attribute::Pointer)` ?
It should be symmetric with the AddrOfOp.
https://github.com/llvm/llvm-project/pull/87723
More information about the flang-commits
mailing list