clang 22.0.0git
clang::CodeGen::CGOpenCLRuntime Class Reference

#include "/home/buildbot/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)
virtual ~CGOpenCLRuntime ()
virtual 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.
virtual llvm::Type * convertOpenCLSpecificType (const Type *T)
virtual llvm::Type * getPipeType (const PipeType *T)
llvm::Type * getSamplerType (const Type *T)
virtual llvm::Value * getPipeElemSize (const Expr *PipeArg)
virtual 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

virtual llvm::Type * getPipeType (const PipeType *T, StringRef Name, llvm::Type *&PipeTy)
llvm::PointerType * getPointerType (const Type *T)

Protected Attributes

CodeGenModuleCGM
llvm::Type * PipeROTy
llvm::Type * PipeWOTy
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 58 of file CGOpenCLRuntime.h.

References CGM, clang::nullptr, PipeROTy, PipeWOTy, and SamplerTy.

◆ ~CGOpenCLRuntime()

CGOpenCLRuntime::~CGOpenCLRuntime ( )
virtual

Definition at line 26 of file CGOpenCLRuntime.cpp.

Member Function Documentation

◆ convertOpenCLSpecificType()

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

Definition at line 33 of file CGOpenCLRuntime.cpp.

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

◆ emitOpenCLEnqueuedBlock()

◆ EmitWorkGroupLocalVarDecl()

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

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 101 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 140 of file CGOpenCLRuntime.cpp.

References EnqueuedBlockMap, and getBlockExpr().

◆ getPipeElemAlign()

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

◆ getPipeElemSize()

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

◆ getPipeType() [1/2]

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

Definition at line 52 of file CGOpenCLRuntime.cpp.

References CGM, getPipeType(), PipeROTy, PipeWOTy, and clang::T.

◆ getPipeType() [2/2]

llvm::Type * CGOpenCLRuntime::getPipeType ( const PipeType * T,
StringRef Name,
llvm::Type *& PipeTy )
protectedvirtual

Definition at line 62 of file CGOpenCLRuntime.cpp.

References getPointerType(), and clang::T.

Referenced by getPipeType().

◆ getPointerType()

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

Definition at line 46 of file CGOpenCLRuntime.cpp.

References CGM, clang::T, 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 127 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 51 of file CGOpenCLRuntime.h.

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

◆ PipeROTy

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

Definition at line 39 of file CGOpenCLRuntime.h.

Referenced by CGOpenCLRuntime(), and getPipeType().

◆ PipeWOTy

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

Definition at line 40 of file CGOpenCLRuntime.h.

Referenced by CGOpenCLRuntime(), and getPipeType().

◆ SamplerTy

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

Definition at line 41 of file CGOpenCLRuntime.h.

Referenced by CGOpenCLRuntime(), and getSamplerType().


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