[flang-commits] [flang] [flang][OpenMP] Support for nocontext and novariants clauses for dispatch construct (PR #227954)

Abid Qadeer via flang-commits flang-commits at lists.llvm.org
Mon Oct 12 10:06:04 PDT 2026


================
@@ -1097,6 +1235,12 @@ extendedValueToHlfirEntity(mlir::Location loc, fir::FirOpBuilder &builder,
     for (auto resUser : insertBefore->getResult(0).getUsers())
       if (auto save_result = llvm::dyn_cast<fir::SaveResultOp>(resUser))
         save_result.getMemrefMutable().assign(declare.getFirBase());
+  // A call with a callee chosen at runtime saves the result in each branch.
+  if (insertBefore && insertBefore->getNumRegions() != 0)
+    insertBefore->walk([&](fir::SaveResultOp saveResult) {
+      if (saveResult.getMemref() == firBase)
+        saveResult.getMemrefMutable().assign(declare.getFirBase());
+    });
----------------
abidh wrote:

The changes in this file touch some generic code like the restructure in genCallOpAndResult and the fir.save_result handling in extendedValueToHlfirEntity. So it would be good to get a review from someone more familiar with that code. @jeanPerier would you mind taking a look?

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


More information about the flang-commits mailing list