clang 23.0.0git
clang::CodeGen::CGOpenCLRuntime Class Reference

#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/CGOpenCLRuntime.h"

Classes

struct  EnqueuedBlockInfo
 Structure for enqueued block information. More...

Public Member Functions

 CGOpenCLRuntime (CodeGenModule &CGM)
 ~CGOpenCLRuntime ()
void EmitWorkGroupLocalVarDecl (CodeGenFunction &CGF, const VarDecl &D)
 Emit the IR required for a work-group-local variable declaration, and add an entry to CGF's LocalDeclMap for D.
llvm::Type * convertOpenCLSpecificType (const Type *T)
llvm::Type * getPipeType (const PipeType *T)
llvm::Type * getSamplerType (const Type *T)
llvm::Value * getPipeElemSize (const Expr *PipeArg)
llvm::Value * getPipeElemAlign (const Expr *PipeArg)
llvm::PointerType * getGenericVoidPointerType ()
EnqueuedBlockInfo emitOpenCLEnqueuedBlock (CodeGenFunction &CGF, const Expr *E)
void recordBlockInfo (const BlockExpr *E, llvm::Function *InvokeF, llvm::Value *Block, llvm::Type *BlockTy)
 Record invoke function and block literal emitted during normal codegen for a block expression.
llvm::Function * getInvokeFunction (const Expr *E)

Protected Member Functions

llvm::PointerType * getPointerType (const Type *T)

Protected Attributes

CodeGenModuleCGM
llvm::Type * PipeTy
llvm::Type * SamplerTy
llvm::DenseMap< const Expr *, EnqueuedBlockInfoEnqueuedBlockMap
 Maps block expression to block information.

Detailed Description

Definition at line 36 of file CGOpenCLRuntime.h.

Constructor & Destructor Documentation

◆ CGOpenCLRuntime()

clang::CodeGen::CGOpenCLRuntime::CGOpenCLRuntime ( CodeGenModule & CGM)
inline

Definition at line 55 of file CGOpenCLRuntime.h.

References CGM, clang::nullptr, PipeTy, and SamplerTy.

◆ ~CGOpenCLRuntime()

CGOpenCLRuntime::~CGOpenCLRuntime ( )

Definition at line 26 of file CGOpenCLRuntime.cpp.

Member Function Documentation

◆ convertOpenCLSpecificType()

llvm::Type * CGOpenCLRuntime::convertOpenCLSpecificType ( const Type * T)

Definition at line 33 of file CGOpenCLRuntime.cpp.

References CGM, getPointerType(), getSamplerType(), and clang::CodeGen::Type.

◆ emitOpenCLEnqueuedBlock()

◆ EmitWorkGroupLocalVarDecl()

void CGOpenCLRuntime::EmitWorkGroupLocalVarDecl ( CodeGenFunction & CGF,
const VarDecl & D )

Emit the IR required for a work-group-local variable declaration, and add an entry to CGF's LocalDeclMap for D.

The base class does this using CodeGenFunction::EmitStaticVarDecl to emit an internal global for D.

Definition at line 28 of file CGOpenCLRuntime.cpp.

References clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().

◆ getGenericVoidPointerType()

llvm::PointerType * CGOpenCLRuntime::getGenericVoidPointerType ( )
Returns
__generic void* type.

Definition at line 93 of file CGOpenCLRuntime.cpp.

References CGM, and clang::opencl_generic.

Referenced by clang::CodeGen::CodeGenModule::getGenericBlockLiteralType(), and initializeForBlockHeader().

◆ getInvokeFunction()

llvm::Function * CGOpenCLRuntime::getInvokeFunction ( const Expr * E)
Returns
LLVM block invoke function emitted for an expression derived from the block expression.

Definition at line 132 of file CGOpenCLRuntime.cpp.

References EnqueuedBlockMap, and getBlockExpr().

◆ getPipeElemAlign()

llvm::Value * CGOpenCLRuntime::getPipeElemAlign ( const Expr * PipeArg)

◆ getPipeElemSize()

llvm::Value * CGOpenCLRuntime::getPipeElemSize ( const Expr * PipeArg)

◆ getPipeType()

llvm::Type * CGOpenCLRuntime::getPipeType ( const PipeType * T)

Definition at line 52 of file CGOpenCLRuntime.cpp.

References CGM, getPointerType(), and PipeTy.

◆ getPointerType()

llvm::PointerType * CGOpenCLRuntime::getPointerType ( const Type * T)
protected

Definition at line 46 of file CGOpenCLRuntime.cpp.

References CGM, and clang::CodeGen::Type.

Referenced by convertOpenCLSpecificType(), getPipeType(), and getSamplerType().

◆ getSamplerType()

llvm::Type * CGOpenCLRuntime::getSamplerType ( const Type * T)

◆ recordBlockInfo()

void CGOpenCLRuntime::recordBlockInfo ( const BlockExpr * E,
llvm::Function * InvokeF,
llvm::Value * Block,
llvm::Type * BlockTy )

Record invoke function and block literal emitted during normal codegen for a block expression.

Record emitted llvm invoke function and llvm block literal for the corresponding block expression.

The information is used by emitOpenCLEnqueuedBlock to emit wrapper kernel.

Parameters
InvokeFinvoke function emitted for the block expression.
Blockblock literal emitted for the block expression.

Definition at line 119 of file CGOpenCLRuntime.cpp.

References clang::Block, clang::CodeGen::CGOpenCLRuntime::EnqueuedBlockInfo::BlockArg, clang::CodeGen::CGOpenCLRuntime::EnqueuedBlockInfo::BlockTy, EnqueuedBlockMap, clang::CodeGen::CGOpenCLRuntime::EnqueuedBlockInfo::InvokeFunc, clang::isa(), and clang::CodeGen::CGOpenCLRuntime::EnqueuedBlockInfo::KernelHandle.

Referenced by buildGlobalBlock().

Member Data Documentation

◆ CGM

◆ EnqueuedBlockMap

llvm::DenseMap<const Expr *, EnqueuedBlockInfo> clang::CodeGen::CGOpenCLRuntime::EnqueuedBlockMap
protected

Maps block expression to block information.

Definition at line 50 of file CGOpenCLRuntime.h.

Referenced by emitOpenCLEnqueuedBlock(), getInvokeFunction(), and recordBlockInfo().

◆ PipeTy

llvm::Type* clang::CodeGen::CGOpenCLRuntime::PipeTy
protected

Definition at line 39 of file CGOpenCLRuntime.h.

Referenced by CGOpenCLRuntime(), getPipeElemAlign(), getPipeElemSize(), and getPipeType().

◆ SamplerTy

llvm::Type* clang::CodeGen::CGOpenCLRuntime::SamplerTy
protected

Definition at line 40 of file CGOpenCLRuntime.h.

Referenced by CGOpenCLRuntime(), and getSamplerType().


The documentation for this class was generated from the following files: