From f1b9e862b4af5c236983ce44f7e8bca5b1ea376f Mon Sep 17 00:00:00 2001 From: Ivan Radanov Ivanov Date: Sun, 4 Aug 2024 22:05:47 +0900 Subject: [PATCH] Only emit unordered loops as omp loops --- flang/lib/Optimizer/Builder/HLFIRTools.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/flang/lib/Optimizer/Builder/HLFIRTools.cpp b/flang/lib/Optimizer/Builder/HLFIRTools.cpp index 91b1b3d774a012..333331378841ed 100644 --- a/flang/lib/Optimizer/Builder/HLFIRTools.cpp +++ b/flang/lib/Optimizer/Builder/HLFIRTools.cpp @@ -858,6 +858,7 @@ hlfir::LoopNest hlfir::genLoopNest(mlir::Location loc, fir::FirOpBuilder &builder, mlir::ValueRange extents, bool isUnordered, bool emitWorkshareLoop) { + emitWorkshareLoop = emitWorkshareLoop && isUnordered; hlfir::LoopNest loopNest; assert(!extents.empty() && "must have at least one extent"); mlir::OpBuilder::InsertionGuard guard(builder);