[flang-commits] [flang] [llvm] [mlir] [OpenMP] Honor barrier and last iteration flags in loop lowering (PR #224040)

Nicole Aschenbrenner via flang-commits flang-commits at lists.llvm.org
Fri Sep 25 01:41:33 PDT 2026


================
@@ -2083,13 +2083,27 @@ static bool opIsInSingleThread(mlir::Operation *op) {
   return false;
 }
 
-static LogicalResult copyFirstPrivateVars(
-    mlir::Operation *op, llvm::IRBuilderBase &builder,
-    LLVM::ModuleTranslation &moduleTranslation,
-    SmallVectorImpl<llvm::Value *> &moldVars,
-    ArrayRef<llvm::Value *> llvmPrivateVars,
-    SmallVectorImpl<omp::PrivateClauseOp> &privateDecls, bool insertBarrier,
-    llvm::DenseMap<Value, Value> *mappedPrivateVars = nullptr) {
+static LogicalResult
+emitPrivatizationBarrier(mlir::Operation *op, llvm::IRBuilderBase &builder,
+                         LLVM::ModuleTranslation &moduleTranslation,
+                         bool insertBarrier) {
+  if (!insertBarrier || opIsInSingleThread(op))
----------------
nicebert wrote:

Fair. `emitPrivatizationBarrier` no longer takes `insertBarrier`, and the callers only call it when a barrier is needed.

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


More information about the flang-commits mailing list