@@ -1096,11 +1096,17 @@ 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
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.
1099
1103
// /
1100
1104
// / \returns Point where to insert code after the workshare construct.
1101
1105
InsertPointOrErrorTy applyStaticWorkshareLoop (
1102
1106
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);
1104
1110
1105
1111
// / Modifies the canonical loop a statically-scheduled workshare loop with a
1106
1112
// / user-specified chunk size.
@@ -1113,13 +1119,22 @@ class OpenMPIRBuilder {
1113
1119
// / \param NeedsBarrier Indicates whether a barrier must be inserted after the
1114
1120
// / loop.
1115
1121
// / \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.
1116
1129
// /
1117
1130
// / \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);
1123
1138
1124
1139
// / Modifies the canonical loop to be a dynamically-scheduled workshare loop.
1125
1140
// /
@@ -1139,14 +1154,15 @@ class OpenMPIRBuilder {
1139
1154
// / the loop.
1140
1155
// / \param Chunk The size of loop chunk considered as a unit when
1141
1156
// / 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.
1142
1160
// /
1143
1161
// / \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 );
1150
1166
1151
1167
// / Create alternative version of the loop to support if clause
1152
1168
// /
@@ -1197,6 +1213,10 @@ class OpenMPIRBuilder {
1197
1213
// / present.
1198
1214
// / \param LoopType Information about type of loop worksharing.
1199
1215
// / 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
1200
1220
// /
1201
1221
// / \returns Point where to insert code after the workshare construct.
1202
1222
LLVM_ABI InsertPointOrErrorTy applyWorkshareLoop (
@@ -1207,7 +1227,8 @@ class OpenMPIRBuilder {
1207
1227
bool HasMonotonicModifier = false , bool HasNonmonotonicModifier = false ,
1208
1228
bool HasOrderedClause = false ,
1209
1229
omp::WorksharingLoopType LoopType =
1210
- omp::WorksharingLoopType::ForStaticLoop);
1230
+ omp::WorksharingLoopType::ForStaticLoop,
1231
+ bool HasDistSchedule = false , Value *DistScheduleChunkSize = nullptr );
1211
1232
1212
1233
// / Tile a loop nest.
1213
1234
// /
0 commit comments