Skip to content

Commit 0efc2ba

Browse files
authored
Merge pull request #1055 from kiranchandramohan/critical_cherry_picks
Cherry pick some patches required for supporting OpenMP critical construct
2 parents 51261bd + 4ff1d0f commit 0efc2ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3731
-229
lines changed

clang/lib/CodeGen/CGStmtOpenMP.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3594,7 +3594,8 @@ void CodeGenFunction::EmitOMPForDirective(const OMPForDirective &S) {
35943594
CGM.getOpenMPRuntime().getOMPBuilder();
35953595
llvm::OpenMPIRBuilder::InsertPointTy AllocaIP(
35963596
AllocaInsertPt->getParent(), AllocaInsertPt->getIterator());
3597-
OMPBuilder.createWorkshareLoop(Builder, CLI, AllocaIP, NeedsBarrier);
3597+
OMPBuilder.applyWorkshareLoop(Builder.getCurrentDebugLocation(), CLI,
3598+
AllocaIP, NeedsBarrier);
35983599
return;
35993600
}
36003601

flang/lib/Lower/OpenMP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ static void genOMP(Fortran::lower::AbstractConverter &converter,
423423
auto currentLocation = converter.getCurrentLocation();
424424
SmallVector<Value, 4> lowerBound, upperBound, step, privateClauseOperands,
425425
firstPrivateClauseOperands, lastPrivateClauseOperands, linearVars,
426-
linearStepVars;
426+
linearStepVars, reductionVars;
427427
mlir::Value scheduleChunkClauseOperand;
428428
mlir::Attribute scheduleClauseOperand, collapseClauseOperand,
429429
noWaitClauseOperand, orderedClauseOperand, orderClauseOperand;
@@ -514,7 +514,7 @@ static void genOMP(Fortran::lower::AbstractConverter &converter,
514514
auto wsLoopOp = firOpBuilder.create<mlir::omp::WsLoopOp>(
515515
currentLocation, resultType, lowerBound, upperBound, step,
516516
privateClauseOperands, firstPrivateClauseOperands,
517-
lastPrivateClauseOperands, linearVars, linearStepVars,
517+
lastPrivateClauseOperands, linearVars, linearStepVars, reductionVars,
518518
scheduleClauseOperand.dyn_cast_or_null<StringAttr>(),
519519
scheduleChunkClauseOperand,
520520
collapseClauseOperand.dyn_cast_or_null<IntegerAttr>(),

llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h

Lines changed: 295 additions & 57 deletions
Large diffs are not rendered by default.

llvm/include/llvm/Frontend/OpenMP/OMPKinds.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,7 @@ __OMP_RTL_ATTRS(__kmpc_task_allow_completion_event, DefaultAttrs,
907907
OMP_IDENT_FLAG(OMP_IDENT_FLAG_##Name, #Name, Value)
908908

909909
__OMP_IDENT_FLAG(KMPC, 0x02)
910+
__OMP_IDENT_FLAG(ATOMIC_REDUCE, 0x10)
910911
__OMP_IDENT_FLAG(BARRIER_EXPL, 0x20)
911912
__OMP_IDENT_FLAG(BARRIER_IMPL, 0x0040)
912913
__OMP_IDENT_FLAG(BARRIER_IMPL_MASK, 0x01C0)

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 234 additions & 30 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)