@@ -1096,11 +1096,17 @@ class OpenMPIRBuilder {
10961096 // / \param NeedsBarrier Indicates whether a barrier must be inserted after
10971097 // / the loop.
10981098 // / \param LoopType Type of workshare loop.
1099+ // / \param HasDistSchedule Defines if the clause being lowered is
1100+ // / dist_schedule as this is handled slightly differently
1101+ // / \param DistScheduleSchedType Defines the Schedule Type for the Distribute
1102+ // / loop. Defaults to None if no Distribute loop is present.
10991103 // /
11001104 // / \returns Point where to insert code after the workshare construct.
11011105 InsertPointOrErrorTy applyStaticWorkshareLoop (
11021106 DebugLoc DL, CanonicalLoopInfo *CLI, InsertPointTy AllocaIP,
1103- omp::WorksharingLoopType LoopType, bool NeedsBarrier);
1107+ omp::WorksharingLoopType LoopType, bool NeedsBarrier,
1108+ bool HasDistSchedule = false ,
1109+ omp::OMPScheduleType DistScheduleSchedType = omp::OMPScheduleType::None);
11041110
11051111 // / Modifies the canonical loop a statically-scheduled workshare loop with a
11061112 // / user-specified chunk size.
@@ -1113,13 +1119,22 @@ class OpenMPIRBuilder {
11131119 // / \param NeedsBarrier Indicates whether a barrier must be inserted after the
11141120 // / loop.
11151121 // / \param ChunkSize The user-specified chunk size.
1122+ // / \param SchedType Optional type of scheduling to be passed to the init
1123+ // / function.
1124+ // / \param DistScheduleChunkSize The size of dist_shcedule chunk considered
1125+ // / as a unit when
1126+ // / scheduling. If \p nullptr, defaults to 1.
1127+ // / \param DistScheduleSchedType Defines the Schedule Type for the Distribute
1128+ // / loop. Defaults to None if no Distribute loop is present.
11161129 // /
11171130 // / \returns Point where to insert code after the workshare construct.
1118- InsertPointOrErrorTy applyStaticChunkedWorkshareLoop (DebugLoc DL,
1119- CanonicalLoopInfo *CLI,
1120- InsertPointTy AllocaIP,
1121- bool NeedsBarrier,
1122- Value *ChunkSize);
1131+ InsertPointOrErrorTy applyStaticChunkedWorkshareLoop (
1132+ DebugLoc DL, CanonicalLoopInfo *CLI, InsertPointTy AllocaIP,
1133+ bool NeedsBarrier, Value *ChunkSize,
1134+ omp::OMPScheduleType SchedType =
1135+ omp::OMPScheduleType::UnorderedStaticChunked,
1136+ Value *DistScheduleChunkSize = nullptr ,
1137+ omp::OMPScheduleType DistScheduleSchedType = omp::OMPScheduleType::None);
11231138
11241139 // / Modifies the canonical loop to be a dynamically-scheduled workshare loop.
11251140 // /
@@ -1139,14 +1154,15 @@ class OpenMPIRBuilder {
11391154 // / the loop.
11401155 // / \param Chunk The size of loop chunk considered as a unit when
11411156 // / scheduling. If \p nullptr, defaults to 1.
1157+ // / \param DistScheduleChunk The size of dist_shcedule chunk considered as
1158+ // / a unit when
1159+ // / scheduling. If \p nullptr, defaults to 1.
11421160 // /
11431161 // / \returns Point where to insert code after the workshare construct.
1144- InsertPointOrErrorTy applyDynamicWorkshareLoop (DebugLoc DL,
1145- CanonicalLoopInfo *CLI,
1146- InsertPointTy AllocaIP,
1147- omp::OMPScheduleType SchedType,
1148- bool NeedsBarrier,
1149- Value *Chunk = nullptr );
1162+ InsertPointOrErrorTy applyDynamicWorkshareLoop (
1163+ DebugLoc DL, CanonicalLoopInfo *CLI, InsertPointTy AllocaIP,
1164+ omp::OMPScheduleType SchedType, bool NeedsBarrier, Value *Chunk = nullptr ,
1165+ Value *DistScheduleChunk = nullptr );
11501166
11511167 // / Create alternative version of the loop to support if clause
11521168 // /
@@ -1197,6 +1213,10 @@ class OpenMPIRBuilder {
11971213 // / present.
11981214 // / \param LoopType Information about type of loop worksharing.
11991215 // / It corresponds to type of loop workshare OpenMP pragma.
1216+ // / \param HasDistSchedule Defines if the clause being lowered is
1217+ // / dist_schedule as this is handled slightly differently
1218+ // /
1219+ // / \param ChunkSize The chunk size for dist_schedule loop
12001220 // /
12011221 // / \returns Point where to insert code after the workshare construct.
12021222 LLVM_ABI InsertPointOrErrorTy applyWorkshareLoop (
@@ -1207,7 +1227,8 @@ class OpenMPIRBuilder {
12071227 bool HasMonotonicModifier = false , bool HasNonmonotonicModifier = false ,
12081228 bool HasOrderedClause = false ,
12091229 omp::WorksharingLoopType LoopType =
1210- omp::WorksharingLoopType::ForStaticLoop);
1230+ omp::WorksharingLoopType::ForStaticLoop,
1231+ bool HasDistSchedule = false , Value *DistScheduleChunkSize = nullptr );
12111232
12121233 // / Tile a loop nest.
12131234 // /
0 commit comments