[flang-commits] [flang] [flang] Support cuf.device_address in FIR AliasAnalysis. (PR #177518)

via flang-commits flang-commits at lists.llvm.org
Fri Jan 23 01:27:51 PST 2026


================
@@ -234,6 +236,29 @@ struct AliasAnalysis {
   /// Return true, if `ty` is a reference type to an object of derived type
   /// that contains a component with POINTER attribute.
   static bool isRecordWithPointerComponent(mlir::Type ty);
+
+  /// Return the symbol table nearest to the given operation.
+  /// If a SymbolTable has not been cached in symTabMap,
+  /// it will be created, which may be expensive.
+  const mlir::SymbolTable *getNearestSymbolTable(mlir::Operation *from);
+
+  /// Return true if the given symbol may correspond to a Fortran variable
+  /// with a TARGET attribute. 'from' is used to find the nearest
+  /// SymbolTable (by calling getNearestSymbolTable()).
+  bool symbolMayHaveTargetAttr(mlir::SymbolRefAttr symbol,
+                               mlir::Operation *from);
+
+  /// A map between operations with OpTrait::SymbolTable
+  /// and the SymbolTable objects associated with them.
+  /// TODO: it might be better to initialize just a single SymbolTable
----------------
jeanPerier wrote:

This would imply that the cost of building the AA is linear with the module size, and that may be too expensive for usages in helpers that create AA on the fly for just a few value that are likely not globals. I personally prefer the lazy approach that you have.

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


More information about the flang-commits mailing list