Skip to content

Commit e5603da

Browse files
authored
[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: #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`
1 parent ff89558 commit e5603da

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)