Skip to content

Commit b99c332

Browse files
Stylie777github-actions[bot]
authored andcommitted
Automerge: [mlir][OpenMP] Fix assert in processing of dist_schedule (#170269)
When #152736 was initially merged, the assert that checks for the chunksize when applying a static-chunked schedule was incorrect. While it would not have changed the behaviour of the assert, the string attached to it would have been emitted in cases where it was simplified. This was raised here: llvm/llvm-project#152736 (comment) Testing for this was explored, but this assert is a last chance failure point that should never be reached as applyWorkshareLoop decides the `EffectiveScheduleType` based on the existence of `ChunkSize` or `DistScheduleChunkSize`, so this will only trigger if there are issues with that conversion, and UnitTesting already exists for `applyWorkshareLoop`
2 parents dd99a38 + e5603da commit b99c332

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5514,8 +5514,8 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::applyWorkshareLoop(
55145514
switch (EffectiveScheduleType & ~OMPScheduleType::ModifierMask) {
55155515
case OMPScheduleType::BaseStatic:
55165516
case OMPScheduleType::BaseDistribute:
5517-
assert(!ChunkSize || !DistScheduleChunkSize &&
5518-
"No chunk size with static-chunked schedule");
5517+
assert((!ChunkSize || !DistScheduleChunkSize) &&
5518+
"No chunk size with static-chunked schedule");
55195519
if (IsOrdered && !HasDistSchedule)
55205520
return applyDynamicWorkshareLoop(DL, CLI, AllocaIP, EffectiveScheduleType,
55215521
NeedsBarrier, ChunkSize);

0 commit comments

Comments
 (0)