@@ -4254,6 +4254,7 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::applyStaticWorkshareLoop(
42544254 Value *PLowerBound = Builder.CreateAlloca (IVTy, nullptr , " p.lowerbound" );
42554255 Value *PUpperBound = Builder.CreateAlloca (IVTy, nullptr , " p.upperbound" );
42564256 Value *PStride = Builder.CreateAlloca (IVTy, nullptr , " p.stride" );
4257+ CLI->setLastIter (PLastIter);
42574258
42584259 // At the end of the preheader, prepare for calling the "init" function by
42594260 // storing the current loop bounds into the allocated space. A canonical loop
@@ -4361,6 +4362,7 @@ OpenMPIRBuilder::applyStaticChunkedWorkshareLoop(DebugLoc DL,
43614362 Value *PUpperBound =
43624363 Builder.CreateAlloca (InternalIVTy, nullptr , " p.upperbound" );
43634364 Value *PStride = Builder.CreateAlloca (InternalIVTy, nullptr , " p.stride" );
4365+ CLI->setLastIter (PLastIter);
43644366
43654367 // Set up the source location value for the OpenMP runtime.
43664368 Builder.restoreIP (CLI->getPreheaderIP ());
@@ -4844,6 +4846,7 @@ OpenMPIRBuilder::applyDynamicWorkshareLoop(DebugLoc DL, CanonicalLoopInfo *CLI,
48444846 Value *PLowerBound = Builder.CreateAlloca (IVTy, nullptr , " p.lowerbound" );
48454847 Value *PUpperBound = Builder.CreateAlloca (IVTy, nullptr , " p.upperbound" );
48464848 Value *PStride = Builder.CreateAlloca (IVTy, nullptr , " p.stride" );
4849+ CLI->setLastIter (PLastIter);
48474850
48484851 // At the end of the preheader, prepare for calling the "init" function by
48494852 // storing the current loop bounds into the allocated space. A canonical loop
0 commit comments