[flang-commits] [flang] [flang] AliasAnalysis: distinguish addr of arg vs. addr in arg (PR #87723)

Joel E. Denny via flang-commits flang-commits at lists.llvm.org
Tue Apr 16 14:18:45 PDT 2024


================
@@ -171,10 +171,28 @@ void AddAliasTagsPass::runOnAliasInterface(fir::FirAliasTagOpInterface op,
                                         << " at " << *op << "\n");
       tag = state.getFuncTree(func).directDataTree.getTag(name);
     } else {
-      // SourceKind::Direct is likely to be extended to cases which are not a
-      // SymbolRefAttr in the future
-      LLVM_DEBUG(llvm::dbgs().indent(2) << "Can't get name for direct "
-                                        << source << " at " << *op << "\n");
+      bool sourceIsDummyArgument = false;
+      if (auto blockArg =
+              source.u.get<mlir::Value>().dyn_cast<mlir::BlockArgument>())
+        sourceIsDummyArgument = blockArg.getOwner()->isEntryBlock();
----------------
jdenny-ornl wrote:

I pushed an attempt to address that case. I'm not sure what fortran produces block arguments for which the old version misbehaves, so I didn't add any new tests. If you have an example, I'd be happy to turn it into a test.

Thanks for the review. Sorry for the delayed response.

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


More information about the flang-commits mailing list