@@ -7025,7 +7025,7 @@ static Function *emitTargetTaskProxyFunction(OpenMPIRBuilder &OMPBuilder,
70257025 // target kernel launch function. If there are local live-in values
70267026 // that the outlined function uses then these are aggregated into a structure
70277027 // which is passed as the second argument. If there are no local live-in
7028- // vallues or if all values used by the outlined kernel are global variables,
7028+ // values or if all values used by the outlined kernel are global variables,
70297029 // then there's only one argument, the threadID. So, StaleCI can be
70307030 //
70317031 // %structArg = alloca { ptr, ptr }, align 8
@@ -7088,8 +7088,9 @@ static Function *emitTargetTaskProxyFunction(OpenMPIRBuilder &OMPBuilder,
70887088 LoadShared->getPointerAlignment (M.getDataLayout ()), SharedsSize);
70897089
70907090 Builder.CreateCall (KernelLaunchFunction, {ThreadId, NewArgStructAlloca});
7091- } else
7091+ } else {
70927092 Builder.CreateCall (KernelLaunchFunction, {ThreadId});
7093+ }
70937094
70947095 Builder.CreateRetVoid ();
70957096 return ProxyFn;
@@ -7246,14 +7247,9 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::emitTargetTask(
72467247 // OI.ExitBlock is set to the single task body block and will get left out of
72477248 // the outlining process. So, simply create a new empty block to which we
72487249 // uncoditionally branch from where TaskBodyCB left off
7249- BasicBlock *TargetTaskContBlock =
7250- BasicBlock::Create (Builder.getContext (), " target.task.cont" );
7251-
7252- auto *CurFn = Builder.GetInsertBlock ()->getParent ();
7253- emitBranch (TargetTaskContBlock);
7254- emitBlock (TargetTaskContBlock, CurFn, /* IsFinished=*/ true );
7255-
7256- OI.ExitBB = TargetTaskContBlock;
7250+ OI.ExitBB = BasicBlock::Create (Builder.getContext (), " target.task.cont" );
7251+ emitBlock (OI.ExitBB , Builder.GetInsertBlock ()->getParent (),
7252+ /* IsFinished=*/ true );
72577253
72587254 OI.PostOutlineCB = [this , ToBeDeleted, Dependencies, HasNoWait,
72597255 DeviceID](Function &OutlinedFn) mutable {
0 commit comments