[flang-commits] [flang] [mlir] [Flang][OpenMP] Support conditional lastprivate on host (PR #200086)

Sunil Shrestha via flang-commits flang-commits at lists.llvm.org
Thu May 28 22:22:17 PDT 2026


================
@@ -2732,6 +2843,26 @@ genSectionsOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
         sectionQueue, sectionQueue.begin());
   }
 
+  // Capture original addresses and rewrite conditional LP assigns in sections.
+  llvm::MapVector<mlir::Value, std::string> condLpOrigAddrs;
+  if (!condLpSyms.empty()) {
+    for (const auto *sym : condLpSyms) {
+      mlir::Value addr = converter.getSymbolAddress(*sym);
+      if (addr)
+        condLpOrigAddrs[addr] = sym->name().ToString();
+    }
+    rewriteConditionalLpAssignsInSections(converter, sectionsOp, lpType,
+                                          condLpOrigAddrs, loc);
----------------
sshrestha-aa wrote:

Initially I thought it'd help with readability, but I agree with you that the helper function in this case probably is not very helpful. 

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


More information about the flang-commits mailing list