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

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Fri Jan 23 08:45:23 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
----------------
vzakhari wrote:

Good point! I updated the comment to describe your concern. It should help future readers understand the trade-off.

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


More information about the flang-commits mailing list