[llvm-branch-commits] [flang] [Flang][OpenMP][Offload] Modify MapInfoFinalization to handle attach mapping and 6.1's ref_* and attach map keywords (PR #177715)

Pranav Bhandarkar via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon May 4 21:54:04 PDT 2026


================
@@ -77,9 +78,15 @@ class MapInfoFinalizationPass
   ///      |                  |
   std::map<mlir::Operation *, mlir::Value> localBoxAllocas;
 
-  // List of deferrable descriptors to process at the end of
-  // the pass.
-  llvm::SmallVector<mlir::Operation *> deferrableDesc;
+  /// List of deferrable descriptors to process at the end of
+  /// the pass and their associated attach map if it exists.
+  llvm::SmallVector<std::pair<mlir::Operation *, mlir::Operation *>>
+      deferrableDesc;
+
+  /// List of base addresses already expanded from their
+  /// descriptors within a parent, currently used to
+  /// prevent incorrect member index generation.
+  std::map<mlir::Operation *, llvm::SmallVector<uint64_t>> expandedBaseAddr;
----------------
bhandarkar-pranav wrote:

Also, looking at how `expansionIndices` are used below, would it make more sense to use a `llvm::DenseSet` instead of a `llvm::SmallVector<uint64_t>`? If I am understanding this correctly, your complexity here is O(n x m) where n is the number of members and m is the number of expanded indices.

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


More information about the llvm-branch-commits mailing list