@@ -4732,6 +4732,7 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::applyStaticWorkshareLoop(
47324732 Value *PLowerBound = Builder.CreateAlloca (IVTy, nullptr , " p.lowerbound" );
47334733 Value *PUpperBound = Builder.CreateAlloca (IVTy, nullptr , " p.upperbound" );
47344734 Value *PStride = Builder.CreateAlloca (IVTy, nullptr , " p.stride" );
4735+ CLI->setLastIter (PLastIter);
47354736
47364737 // At the end of the preheader, prepare for calling the "init" function by
47374738 // storing the current loop bounds into the allocated space. A canonical loop
@@ -4840,6 +4841,7 @@ OpenMPIRBuilder::applyStaticChunkedWorkshareLoop(DebugLoc DL,
48404841 Value *PUpperBound =
48414842 Builder.CreateAlloca (InternalIVTy, nullptr , " p.upperbound" );
48424843 Value *PStride = Builder.CreateAlloca (InternalIVTy, nullptr , " p.stride" );
4844+ CLI->setLastIter (PLastIter);
48434845
48444846 // Set up the source location value for the OpenMP runtime.
48454847 Builder.restoreIP (CLI->getPreheaderIP ());
@@ -5325,6 +5327,7 @@ OpenMPIRBuilder::applyDynamicWorkshareLoop(DebugLoc DL, CanonicalLoopInfo *CLI,
53255327 Value *PLowerBound = Builder.CreateAlloca (IVTy, nullptr , " p.lowerbound" );
53265328 Value *PUpperBound = Builder.CreateAlloca (IVTy, nullptr , " p.upperbound" );
53275329 Value *PStride = Builder.CreateAlloca (IVTy, nullptr , " p.stride" );
5330+ CLI->setLastIter (PLastIter);
53285331
53295332 // At the end of the preheader, prepare for calling the "init" function by
53305333 // storing the current loop bounds into the allocated space. A canonical loop
0 commit comments