[llvm] e5603da - [mlir][OpenMP] Fix assert in processing of dist_schedule (#170269)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 4 02:00:14 PST 2025
Author: Jack Styles
Date: 2025-12-04T10:00:09Z
New Revision: e5603da73dc2299c635e1040506039c14e77e4aa
URL: https://github.com/llvm/llvm-project/commit/e5603da73dc2299c635e1040506039c14e77e4aa
DIFF: https://github.com/llvm/llvm-project/commit/e5603da73dc2299c635e1040506039c14e77e4aa.diff
LOG: [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:
https://github.com/llvm/llvm-project/pull/152736#discussion_r2578314276
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`
Added:
Modified:
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
index 6f73d0c8dbfa2..553333d53a106 100644
--- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
@@ -5514,8 +5514,8 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::applyWorkshareLoop(
switch (EffectiveScheduleType & ~OMPScheduleType::ModifierMask) {
case OMPScheduleType::BaseStatic:
case OMPScheduleType::BaseDistribute:
- assert(!ChunkSize || !DistScheduleChunkSize &&
- "No chunk size with static-chunked schedule");
+ assert((!ChunkSize || !DistScheduleChunkSize) &&
+ "No chunk size with static-chunked schedule");
if (IsOrdered && !HasDistSchedule)
return applyDynamicWorkshareLoop(DL, CLI, AllocaIP, EffectiveScheduleType,
NeedsBarrier, ChunkSize);
More information about the llvm-commits
mailing list