@@ -1096,11 +1096,13 @@ class OpenMPIRBuilder {
1096
1096
// / \param NeedsBarrier Indicates whether a barrier must be inserted after
1097
1097
// / the loop.
1098
1098
// / \param LoopType Type of workshare loop.
1099
+ // / \param HasDistSchedule Defines if the clause being lowered is dist_schedule as this is handled slightly differently
1100
+ // / \param DistScheduleSchedType Defines the Schedule Type for the Distribute loop. Defaults to None if no Distribute loop is present.
1099
1101
// /
1100
1102
// / \returns Point where to insert code after the workshare construct.
1101
1103
InsertPointOrErrorTy applyStaticWorkshareLoop (
1102
1104
DebugLoc DL, CanonicalLoopInfo *CLI, InsertPointTy AllocaIP,
1103
- omp::WorksharingLoopType LoopType, bool NeedsBarrier);
1105
+ omp::WorksharingLoopType LoopType, bool NeedsBarrier, bool HasDistSchedule = false , omp::OMPScheduleType DistScheduleSchedType = omp::OMPScheduleType::None );
1104
1106
1105
1107
// / Modifies the canonical loop a statically-scheduled workshare loop with a
1106
1108
// / user-specified chunk size.
@@ -1113,13 +1115,20 @@ class OpenMPIRBuilder {
1113
1115
// / \param NeedsBarrier Indicates whether a barrier must be inserted after the
1114
1116
// / loop.
1115
1117
// / \param ChunkSize The user-specified chunk size.
1118
+ // / \param SchedType Optional type of scheduling to be passed to the init function.
1119
+ // / \param DistScheduleChunkSize The size of dist_shcedule chunk considered as a unit when
1120
+ // / scheduling. If \p nullptr, defaults to 1.
1121
+ // / \param DistScheduleSchedType Defines the Schedule Type for the Distribute loop. Defaults to None if no Distribute loop is present.
1116
1122
// /
1117
1123
// / \returns Point where to insert code after the workshare construct.
1118
1124
InsertPointOrErrorTy applyStaticChunkedWorkshareLoop (DebugLoc DL,
1119
1125
CanonicalLoopInfo *CLI,
1120
1126
InsertPointTy AllocaIP,
1121
1127
bool NeedsBarrier,
1122
- Value *ChunkSize);
1128
+ Value *ChunkSize,
1129
+ omp::OMPScheduleType SchedType = omp::OMPScheduleType::UnorderedStaticChunked,
1130
+ Value *DistScheduleChunkSize = nullptr ,
1131
+ omp::OMPScheduleType DistScheduleSchedType = omp::OMPScheduleType::None);
1123
1132
1124
1133
// / Modifies the canonical loop to be a dynamically-scheduled workshare loop.
1125
1134
// /
@@ -1139,14 +1148,17 @@ class OpenMPIRBuilder {
1139
1148
// / the loop.
1140
1149
// / \param Chunk The size of loop chunk considered as a unit when
1141
1150
// / scheduling. If \p nullptr, defaults to 1.
1151
+ // / \param DistScheduleChunk The size of dist_shcedule chunk considered as a unit when
1152
+ // / scheduling. If \p nullptr, defaults to 1.
1142
1153
// /
1143
1154
// / \returns Point where to insert code after the workshare construct.
1144
1155
InsertPointOrErrorTy applyDynamicWorkshareLoop (DebugLoc DL,
1145
1156
CanonicalLoopInfo *CLI,
1146
1157
InsertPointTy AllocaIP,
1147
1158
omp::OMPScheduleType SchedType,
1148
1159
bool NeedsBarrier,
1149
- Value *Chunk = nullptr );
1160
+ Value *Chunk = nullptr ,
1161
+ Value *DistScheduleChunk = nullptr );
1150
1162
1151
1163
// / Create alternative version of the loop to support if clause
1152
1164
// /
@@ -1197,6 +1209,9 @@ class OpenMPIRBuilder {
1197
1209
// / present.
1198
1210
// / \param LoopType Information about type of loop worksharing.
1199
1211
// / It corresponds to type of loop workshare OpenMP pragma.
1212
+ // / \param HasDistSchedule Defines if the clause being lowered is dist_schedule as this is handled slightly differently
1213
+ // /
1214
+ // / \param ChunkSize The chunk size for dist_schedule loop
1200
1215
// /
1201
1216
// / \returns Point where to insert code after the workshare construct.
1202
1217
LLVM_ABI InsertPointOrErrorTy applyWorkshareLoop (
@@ -1207,7 +1222,9 @@ class OpenMPIRBuilder {
1207
1222
bool HasMonotonicModifier = false , bool HasNonmonotonicModifier = false ,
1208
1223
bool HasOrderedClause = false ,
1209
1224
omp::WorksharingLoopType LoopType =
1210
- omp::WorksharingLoopType::ForStaticLoop);
1225
+ omp::WorksharingLoopType::ForStaticLoop,
1226
+ bool HasDistSchedule = false ,
1227
+ Value* DistScheduleChunkSize = nullptr );
1211
1228
1212
1229
// / Tile a loop nest.
1213
1230
// /
0 commit comments