• Home
  • Raw
  • Download

Lines Matching refs:CGF

24 llvm::Value *CGOpenMPRuntimeNVPTX::getNVPTXWarpSize(CodeGenFunction &CGF) {  in getNVPTXWarpSize()  argument
25 CGBuilderTy &Bld = CGF.Builder; in getNVPTXWarpSize()
33 llvm::Value *CGOpenMPRuntimeNVPTX::getNVPTXThreadID(CodeGenFunction &CGF) { in getNVPTXThreadID() argument
34 CGBuilderTy &Bld = CGF.Builder; in getNVPTXThreadID()
42 llvm::Value *CGOpenMPRuntimeNVPTX::getNVPTXNumThreads(CodeGenFunction &CGF) { in getNVPTXNumThreads() argument
43 CGBuilderTy &Bld = CGF.Builder; in getNVPTXNumThreads()
51 void CGOpenMPRuntimeNVPTX::getNVPTXCTABarrier(CodeGenFunction &CGF) { in getNVPTXCTABarrier() argument
52 CGBuilderTy &Bld = CGF.Builder; in getNVPTXCTABarrier()
58 void CGOpenMPRuntimeNVPTX::syncCTAThreads(CodeGenFunction &CGF) { in syncCTAThreads() argument
59 getNVPTXCTABarrier(CGF); in syncCTAThreads()
69 llvm::Value *CGOpenMPRuntimeNVPTX::getMasterThreadID(CodeGenFunction &CGF) { in getMasterThreadID() argument
70 CGBuilderTy &Bld = CGF.Builder; in getMasterThreadID()
71 llvm::Value *NumThreads = getNVPTXNumThreads(CGF); in getMasterThreadID()
74 llvm::Value *Mask = Bld.CreateSub(getNVPTXWarpSize(CGF), Bld.getInt32(1)); in getMasterThreadID()
136 CodeGenFunction CGF(CGM, /*suppressNewContext=*/true); in emitWorkerFunction() local
137 CGF.StartFunction(GlobalDecl(), Ctx.VoidTy, WST.WorkerFn, *WST.CGFI, {}); in emitWorkerFunction()
138 emitWorkerLoop(CGF, WST); in emitWorkerFunction()
139 CGF.FinishFunction(); in emitWorkerFunction()
142 void CGOpenMPRuntimeNVPTX::emitWorkerLoop(CodeGenFunction &CGF, in emitWorkerLoop() argument
153 CGBuilderTy &Bld = CGF.Builder; in emitWorkerLoop()
155 llvm::BasicBlock *AwaitBB = CGF.createBasicBlock(".await.work"); in emitWorkerLoop()
156 llvm::BasicBlock *SelectWorkersBB = CGF.createBasicBlock(".select.workers"); in emitWorkerLoop()
157 llvm::BasicBlock *ExecuteBB = CGF.createBasicBlock(".execute.parallel"); in emitWorkerLoop()
158 llvm::BasicBlock *TerminateBB = CGF.createBasicBlock(".terminate.parallel"); in emitWorkerLoop()
159 llvm::BasicBlock *BarrierBB = CGF.createBasicBlock(".barrier.parallel"); in emitWorkerLoop()
160 llvm::BasicBlock *ExitBB = CGF.createBasicBlock(".exit"); in emitWorkerLoop()
162 CGF.EmitBranch(AwaitBB); in emitWorkerLoop()
165 CGF.EmitBlock(AwaitBB); in emitWorkerLoop()
167 syncCTAThreads(CGF); in emitWorkerLoop()
176 CGF.EmitBlock(SelectWorkersBB); in emitWorkerLoop()
177 llvm::Value *ThreadID = getNVPTXThreadID(CGF); in emitWorkerLoop()
185 CGF.EmitBlock(ExecuteBB); in emitWorkerLoop()
189 CGF.EmitBlock(TerminateBB); in emitWorkerLoop()
190 CGF.EmitBranch(BarrierBB); in emitWorkerLoop()
193 CGF.EmitBlock(BarrierBB); in emitWorkerLoop()
195 syncCTAThreads(CGF); in emitWorkerLoop()
196 CGF.EmitBranch(AwaitBB); in emitWorkerLoop()
199 CGF.EmitBlock(ExitBB); in emitWorkerLoop()
203 void CGOpenMPRuntimeNVPTX::emitEntryHeader(CodeGenFunction &CGF, in emitEntryHeader() argument
206 CGBuilderTy &Bld = CGF.Builder; in emitEntryHeader()
209 llvm::Value *MasterID = getMasterThreadID(CGF); in emitEntryHeader()
211 llvm::Value *ThreadID = getNVPTXThreadID(CGF); in emitEntryHeader()
214 llvm::BasicBlock *WorkerCheckBB = CGF.createBasicBlock(".check.for.worker"); in emitEntryHeader()
215 llvm::BasicBlock *WorkerBB = CGF.createBasicBlock(".worker"); in emitEntryHeader()
216 llvm::BasicBlock *MasterBB = CGF.createBasicBlock(".master"); in emitEntryHeader()
217 EST.ExitBB = CGF.createBasicBlock(".exit"); in emitEntryHeader()
226 CGF.EmitBlock(WorkerCheckBB); in emitEntryHeader()
231 CGF.EmitBlock(WorkerBB); in emitEntryHeader()
232 CGF.EmitCallOrInvoke(WST.WorkerFn, llvm::None); in emitEntryHeader()
233 CGF.EmitBranch(EST.ExitBB); in emitEntryHeader()
236 CGF.EmitBlock(MasterBB); in emitEntryHeader()
240 llvm::Value *Args[] = {Bld.getInt32(/*OmpHandle=*/0), getNVPTXThreadID(CGF)}; in emitEntryHeader()
241 CGF.EmitRuntimeCall(createNVPTXRuntimeFunction(OMPRTL_NVPTX__kmpc_kernel_init), in emitEntryHeader()
245 void CGOpenMPRuntimeNVPTX::emitEntryFooter(CodeGenFunction &CGF, in emitEntryFooter() argument
247 CGBuilderTy &Bld = CGF.Builder; in emitEntryFooter()
248 llvm::BasicBlock *TerminateBB = CGF.createBasicBlock(".termination.notifier"); in emitEntryFooter()
249 CGF.EmitBranch(TerminateBB); in emitEntryFooter()
251 CGF.EmitBlock(TerminateBB); in emitEntryFooter()
257 syncCTAThreads(CGF); in emitEntryFooter()
259 CGF.EmitBranch(EST.ExitBB); in emitEntryFooter()
261 CGF.EmitBlock(EST.ExitBB); in emitEntryFooter()
330 void Enter(CodeGenFunction &CGF) override { in emitTargetOutlinedFunction() argument
331 RT.emitEntryHeader(CGF, EST, WST); in emitTargetOutlinedFunction()
333 void Exit(CodeGenFunction &CGF) override { RT.emitEntryFooter(CGF, EST); } in emitTargetOutlinedFunction() argument
356 void CGOpenMPRuntimeNVPTX::emitNumTeamsClause(CodeGenFunction &CGF, in emitNumTeamsClause() argument
379 void CGOpenMPRuntimeNVPTX::emitTeamsCall(CodeGenFunction &CGF, in emitTeamsCall() argument
384 if (!CGF.HaveInsertPoint()) in emitTeamsCall()
388 CGF.CreateTempAlloca(CGF.Int32Ty, CharUnits::fromQuantity(4), in emitTeamsCall()
390 CGF.InitTempAlloca(ZeroAddr, CGF.Builder.getInt32(/*C*/ 0)); in emitTeamsCall()
395 CGF.EmitCallOrInvoke(OutlinedFn, OutlinedFnArgs); in emitTeamsCall()