Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5377,7 +5377,10 @@ OpenMPIRBuilder::applyStaticChunkedWorkshareLoop(
ConstantInt::get(I32Type, static_cast<int>(DistScheduleSchedType));
Builder.CreateStore(Zero, PLowerBound);
Value *OrigUpperBound = Builder.CreateSub(CastedTripCount, One);
Builder.CreateStore(OrigUpperBound, PUpperBound);
Value *IsTripCountZero = Builder.CreateICmpEQ(CastedTripCount, Zero);
Value *UpperBound =
Builder.CreateSelect(IsTripCountZero, Zero, OrigUpperBound);
Builder.CreateStore(UpperBound, PUpperBound);
Builder.CreateStore(One, PStride);

// Call the "init" function and update the trip count of the loop with the
Expand Down