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

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri May 8 21:10:00 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;
----------------
agozillon wrote:

First iteration and I'm unfamiliar with the llvm::Dense series, so keeping it simple seemed best to make sure it all fundamentally works, it also aligns with the other container usage in the file :-) 

It's also a little rare to be dealing with significant numbers of maps in any of the containers at once as they're cleared on a function by function case, it is possible to have large functions with a lot of maps though (some SPEC benchmarks being an example). However, if you think it's more optimal, I'm happy to make the swap.

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


More information about the llvm-branch-commits mailing list