clang 22.0.0git
clang::CodeGen::CGHLSLRuntime Class Reference

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

Public Member Functions

 GENERATE_HLSL_INTRINSIC_FUNCTION (FlattenedThreadIdInGroup, flattened_thread_id_in_group) GENERATE_HLSL_INTRINSIC_FUNCTION(CreateResourceGetPointer
resource_getpointer GENERATE_HLSL_INTRINSIC_FUNCTION (CreateHandleFromBinding, resource_handlefrombinding) GENERATE_HLSL_INTRINSIC_FUNCTION(CreateHandleFromImplicitBinding
resource_getpointer resource_handlefromimplicitbinding GENERATE_HLSL_INTRINSIC_FUNCTION (NonUniformResourceIndex, resource_nonuniformindex) GENERATE_HLSL_INTRINSIC_FUNCTION(GroupMemoryBarrierWithGroupSync
 CGHLSLRuntime (CodeGenModule &CGM)
virtual ~CGHLSLRuntime ()
llvm::Type * convertHLSLSpecificType (const Type *T, const CGHLSLOffsetInfo &OffsetInfo)
llvm::Type * convertHLSLSpecificType (const Type *T)
void generateGlobalCtorDtorCalls ()
void addBuffer (const HLSLBufferDecl *D)
void addRootSignature (const HLSLRootSignatureDecl *D)
void finishCodeGen ()
void setHLSLEntryAttributes (const FunctionDecl *FD, llvm::Function *Fn)
void emitEntryFunction (const FunctionDecl *FD, llvm::Function *Fn)
void setHLSLFunctionAttributes (const FunctionDecl *FD, llvm::Function *Fn)
void handleGlobalVarDefinition (const VarDecl *VD, llvm::GlobalVariable *Var)
llvm::Instruction * getConvergenceToken (llvm::BasicBlock &BB)
llvm::StructType * getHLSLBufferLayoutType (const RecordType *LayoutStructTy)
void addHLSLBufferLayoutType (const RecordType *LayoutStructTy, llvm::StructType *LayoutTy)
void emitInitListOpaqueValues (CodeGenFunction &CGF, InitListExpr *E)
std::optional< LValueemitResourceArraySubscriptExpr (const ArraySubscriptExpr *E, CodeGenFunction &CGF)
std::optional< LValueemitBufferArraySubscriptExpr (const ArraySubscriptExpr *E, CodeGenFunction &CGF, llvm::function_ref< llvm::Value *(bool Promote)> EmitIdxAfterBase)
bool emitBufferCopy (CodeGenFunction &CGF, Address DestPtr, Address SrcPtr, QualType CType)
LValue emitBufferMemberExpr (CodeGenFunction &CGF, const MemberExpr *E)

Protected Member Functions

llvm::Value * emitSystemSemanticLoad (llvm::IRBuilder<> &B, llvm::Type *Type, const clang::DeclaratorDecl *Decl, HLSLAppliedSemanticAttr *Semantic, std::optional< unsigned > Index)
void emitSystemSemanticStore (llvm::IRBuilder<> &B, llvm::Value *Source, const clang::DeclaratorDecl *Decl, HLSLAppliedSemanticAttr *Semantic, std::optional< unsigned > Index)
llvm::Value * handleScalarSemanticLoad (llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Type *Type, const clang::DeclaratorDecl *Decl, HLSLAppliedSemanticAttr *Semantic)
void handleScalarSemanticStore (llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Value *Source, const clang::DeclaratorDecl *Decl, HLSLAppliedSemanticAttr *Semantic)
std::pair< llvm::Value *, specific_attr_iterator< HLSLAppliedSemanticAttr > > handleStructSemanticLoad (llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Type *Type, const clang::DeclaratorDecl *Decl, specific_attr_iterator< HLSLAppliedSemanticAttr > begin, specific_attr_iterator< HLSLAppliedSemanticAttr > end)
specific_attr_iterator< HLSLAppliedSemanticAttr > handleStructSemanticStore (llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Value *Source, const clang::DeclaratorDecl *Decl, specific_attr_iterator< HLSLAppliedSemanticAttr > AttrBegin, specific_attr_iterator< HLSLAppliedSemanticAttr > AttrEnd)
std::pair< llvm::Value *, specific_attr_iterator< HLSLAppliedSemanticAttr > > handleSemanticLoad (llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Type *Type, const clang::DeclaratorDecl *Decl, specific_attr_iterator< HLSLAppliedSemanticAttr > begin, specific_attr_iterator< HLSLAppliedSemanticAttr > end)
specific_attr_iterator< HLSLAppliedSemanticAttr > handleSemanticStore (llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Value *Source, const clang::DeclaratorDecl *Decl, specific_attr_iterator< HLSLAppliedSemanticAttr > AttrBegin, specific_attr_iterator< HLSLAppliedSemanticAttr > AttrEnd)

Protected Attributes

CodeGenModuleCGM

Detailed Description

Definition at line 117 of file CGHLSLRuntime.h.

Constructor & Destructor Documentation

◆ CGHLSLRuntime()

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

Definition at line 229 of file CGHLSLRuntime.h.

References CGHLSLRuntime(), and CGM.

Referenced by CGHLSLRuntime().

◆ ~CGHLSLRuntime()

virtual clang::CodeGen::CGHLSLRuntime::~CGHLSLRuntime ( )
inlinevirtual

Definition at line 230 of file CGHLSLRuntime.h.

Member Function Documentation

◆ addBuffer()

◆ addHLSLBufferLayoutType()

void CGHLSLRuntime::addHLSLBufferLayoutType ( const RecordType * LayoutStructTy,
llvm::StructType * LayoutTy )

Definition at line 462 of file CGHLSLRuntime.cpp.

References getHLSLBufferLayoutType().

◆ addRootSignature()

◆ convertHLSLSpecificType() [1/2]

llvm::Type * clang::CodeGen::CGHLSLRuntime::convertHLSLSpecificType ( const Type * T)
inline

Definition at line 234 of file CGHLSLRuntime.h.

References convertHLSLSpecificType(), clang::T, and clang::CodeGen::Type.

◆ convertHLSLSpecificType() [2/2]

llvm::Type * CGHLSLRuntime::convertHLSLSpecificType ( const Type * T,
const CGHLSLOffsetInfo & OffsetInfo )

Definition at line 266 of file CGHLSLRuntime.cpp.

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

Referenced by addBuffer(), and convertHLSLSpecificType().

◆ emitBufferArraySubscriptExpr()

◆ emitBufferCopy()

bool CGHLSLRuntime::emitBufferCopy ( CodeGenFunction & CGF,
Address DestPtr,
Address SrcPtr,
QualType CType )

Definition at line 1482 of file CGHLSLRuntime.cpp.

◆ emitBufferMemberExpr()

◆ emitEntryFunction()

◆ emitInitListOpaqueValues()

◆ emitResourceArraySubscriptExpr()

◆ emitSystemSemanticLoad()

llvm::Value * CGHLSLRuntime::emitSystemSemanticLoad ( llvm::IRBuilder<> & B,
llvm::Type * Type,
const clang::DeclaratorDecl * Decl,
HLSLAppliedSemanticAttr * Semantic,
std::optional< unsigned > Index )
protected

◆ emitSystemSemanticStore()

void CGHLSLRuntime::emitSystemSemanticStore ( llvm::IRBuilder<> & B,
llvm::Value * Source,
const clang::DeclaratorDecl * Decl,
HLSLAppliedSemanticAttr * Semantic,
std::optional< unsigned > Index )
protected

Definition at line 766 of file CGHLSLRuntime.cpp.

References CGM, createSPIRVBuiltinStore(), and clang::CodeGen::Decl.

Referenced by handleScalarSemanticStore().

◆ finishCodeGen()

void CGHLSLRuntime::finishCodeGen ( )

Definition at line 469 of file CGHLSLRuntime.cpp.

References CGM, generateGlobalCtorDtorCalls(), and clang::T.

Referenced by clang::CodeGen::CodeGenModule::Release().

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [1/3]

resource_getpointer clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( CreateHandleFromBinding ,
resource_handlefrombinding  )

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [2/3]

clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( FlattenedThreadIdInGroup ,
flattened_thread_id_in_group  )

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [3/3]

resource_getpointer resource_handlefromimplicitbinding clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( NonUniformResourceIndex ,
resource_nonuniformindex  )

◆ generateGlobalCtorDtorCalls()

void CGHLSLRuntime::generateGlobalCtorDtorCalls ( )

Definition at line 1022 of file CGHLSLRuntime.cpp.

References CGM, gatherFunctions(), getConvergenceToken(), and clang::T.

Referenced by finishCodeGen().

◆ getConvergenceToken()

llvm::Instruction * CGHLSLRuntime::getConvergenceToken ( llvm::BasicBlock & BB)

Definition at line 1136 of file CGHLSLRuntime.cpp.

References CGM.

Referenced by generateGlobalCtorDtorCalls().

◆ getHLSLBufferLayoutType()

llvm::StructType * CGHLSLRuntime::getHLSLBufferLayoutType ( const RecordType * LayoutStructTy)

Definition at line 455 of file CGHLSLRuntime.cpp.

Referenced by addHLSLBufferLayoutType().

◆ handleGlobalVarDefinition()

void CGHLSLRuntime::handleGlobalVarDefinition ( const VarDecl * VD,
llvm::GlobalVariable * Var )

Definition at line 1130 of file CGHLSLRuntime.cpp.

References addSPIRVBuiltinDecoration(), and clang::Decl::getAttr().

◆ handleScalarSemanticLoad()

llvm::Value * CGHLSLRuntime::handleScalarSemanticLoad ( llvm::IRBuilder<> & B,
const FunctionDecl * FD,
llvm::Type * Type,
const clang::DeclaratorDecl * Decl,
HLSLAppliedSemanticAttr * Semantic )
protected

◆ handleScalarSemanticStore()

void CGHLSLRuntime::handleScalarSemanticStore ( llvm::IRBuilder<> & B,
const FunctionDecl * FD,
llvm::Value * Source,
const clang::DeclaratorDecl * Decl,
HLSLAppliedSemanticAttr * Semantic )
protected

Definition at line 800 of file CGHLSLRuntime.cpp.

References clang::CodeGen::Decl, and emitSystemSemanticStore().

Referenced by handleSemanticStore().

◆ handleSemanticLoad()

std::pair< llvm::Value *, specific_attr_iterator< HLSLAppliedSemanticAttr > > CGHLSLRuntime::handleSemanticLoad ( llvm::IRBuilder<> & B,
const FunctionDecl * FD,
llvm::Type * Type,
const clang::DeclaratorDecl * Decl,
specific_attr_iterator< HLSLAppliedSemanticAttr > begin,
specific_attr_iterator< HLSLAppliedSemanticAttr > end )
protected

◆ handleSemanticStore()

specific_attr_iterator< HLSLAppliedSemanticAttr > CGHLSLRuntime::handleSemanticStore ( llvm::IRBuilder<> & B,
const FunctionDecl * FD,
llvm::Value * Source,
const clang::DeclaratorDecl * Decl,
specific_attr_iterator< HLSLAppliedSemanticAttr > AttrBegin,
specific_attr_iterator< HLSLAppliedSemanticAttr > AttrEnd )
protected

◆ handleStructSemanticLoad()

std::pair< llvm::Value *, specific_attr_iterator< HLSLAppliedSemanticAttr > > CGHLSLRuntime::handleStructSemanticLoad ( llvm::IRBuilder<> & B,
const FunctionDecl * FD,
llvm::Type * Type,
const clang::DeclaratorDecl * Decl,
specific_attr_iterator< HLSLAppliedSemanticAttr > begin,
specific_attr_iterator< HLSLAppliedSemanticAttr > end )
protected

◆ handleStructSemanticStore()

specific_attr_iterator< HLSLAppliedSemanticAttr > CGHLSLRuntime::handleStructSemanticStore ( llvm::IRBuilder<> & B,
const FunctionDecl * FD,
llvm::Value * Source,
const clang::DeclaratorDecl * Decl,
specific_attr_iterator< HLSLAppliedSemanticAttr > AttrBegin,
specific_attr_iterator< HLSLAppliedSemanticAttr > AttrEnd )
protected

◆ setHLSLEntryAttributes()

void clang::CodeGen::CGHLSLRuntime::setHLSLEntryAttributes ( const FunctionDecl * FD,
llvm::Function * Fn )

Definition at line 490 of file CGHLSLRuntime.cpp.

References CGM, and clang::Decl::getAttr().

Referenced by emitEntryFunction().

◆ setHLSLFunctionAttributes()

void clang::CodeGen::CGHLSLRuntime::setHLSLFunctionAttributes ( const FunctionDecl * FD,
llvm::Function * Fn )

Member Data Documentation

◆ CGM


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