[Mlir-commits] [llvm] [mlir] [Flang][OpenMP][OpenMPIRBuilder] Implement module scope declare target use rewrite mechanism (PR #212920)

Sergio Afonso llvmlistbot at llvm.org
Mon Aug 3 07:06:15 PDT 2026


================
@@ -2669,6 +2684,22 @@ class OpenMPIRBuilder {
   /// outline info's have been processed.
   SmallVector<llvm::Function *, 16> ConstantAllocaRaiseCandidates;
 
+  /// Describes a declare target global variable replacement to be applied
+  /// during finalization.
+  struct DeclareTargetGlobalReplacement {
+    GlobalValue *Original;
+    GlobalValue *Replacement;
+  };
+
+  /// Collection of declare target globals to rewrite uses of during
+  /// finalizaiton.
+  SmallVector<DeclareTargetGlobalReplacement, 8>
+      DeclareTargetGlobalReplacements;
+
+  /// Rewrites uses of registered declare target globals to their
+  /// replacements.
+  void applyDeclareTargetGlobalReplacements();
----------------
skatrak wrote:

Nit: Shouldn't this be `private` to the class?

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


More information about the Mlir-commits mailing list