clang 24.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(QuadReadAcrossDiagonal
quad_read_across_diagonal GENERATE_HLSL_INTRINSIC_FUNCTION (CreateResourceGetBasePointer, resource_getbasepointer) GENERATE_HLSL_INTRINSIC_FUNCTION(CreateResourceGetPointer
quad_read_across_diagonal resource_getpointer GENERATE_HLSL_INTRINSIC_FUNCTION (SampleCmpLevelZero, resource_samplecmplevelzero) GENERATE_HLSL_INTRINSIC_FUNCTION(CreateHandleFromBinding
quad_read_across_diagonal resource_getpointer resource_handlefrombinding GENERATE_HLSL_INTRINSIC_FUNCTION (CreateHandleFromImplicitBinding, resource_handlefromimplicitbinding) GENERATE_HLSL_INTRINSIC_FUNCTION(CreateHandleFromHeap
quad_read_across_diagonal resource_getpointer resource_handlefrombinding resource_handlefromheap GENERATE_HLSL_INTRINSIC_FUNCTION (NonUniformResourceIndex, resource_nonuniformindex) GENERATE_HLSL_INTRINSIC_FUNCTION(AllMemoryBarrierWithGroupSync
quad_read_across_diagonal resource_getpointer resource_handlefrombinding resource_handlefromheap all_memory_barrier_with_group_sync GENERATE_HLSL_INTRINSIC_FUNCTION (DeviceMemoryBarrierWithGroupSync, device_memory_barrier_with_group_sync) GENERATE_HLSL_INTRINSIC_FUNCTION(GroupMemoryBarrierWithGroupSync
quad_read_across_diagonal resource_getpointer resource_handlefrombinding resource_handlefromheap all_memory_barrier_with_group_sync group_memory_barrier_with_group_sync GENERATE_HLSL_INTRINSIC_FUNCTION (GetDimensionsLevelsXY, resource_getdimensions_levels_xy) GENERATE_HLSL_INTRINSIC_FUNCTION(CalculateLodUnclamped
 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< LValue > emitResourceArraySubscriptExpr (const ArraySubscriptExpr *E, CodeGenFunction &CGF)
bool emitGlobalResourceArray (CodeGenFunction &CGF, const Expr *E, AggValueSlot &DestSlot)
std::optional< LValue > emitGlobalResourceArrayAsLValue (CodeGenFunction &CGF, const VarDecl *ArrayDecl)
std::optional< LValue > emitBufferArraySubscriptExpr (const ArraySubscriptExpr *E, CodeGenFunction &CGF, llvm::function_ref< llvm::Value *(bool Promote)> EmitIdxAfterBase)
RawAddress createBufferMatrixTempAddress (const LValue &LV, CodeGenFunction &CGF)
bool emitBufferCopy (CodeGenFunction &CGF, const Expr *E, const LValue &SrcLV, AggValueSlot &DestSlot)
LValue emitBufferMemberExpr (CodeGenFunction &CGF, const MemberExpr *E)
std::optional< LValue > emitResourceMemberExpr (CodeGenFunction &CGF, const MemberExpr *E)

Protected Types

using SemanticSignatures

Protected Member Functions

llvm::Value * emitSystemSemanticLoad (llvm::IRBuilder<> &B, llvm::Type *Type, const clang::DeclaratorDecl *Decl, HLSLAppliedSemanticAttr *Semantic, llvm::dxbc::PSV::SemanticKind SemanticKind, llvm::Triple::EnvironmentType Stage, std::optional< unsigned > Index, SemanticSignatures &Signature)
void emitSystemSemanticStore (llvm::IRBuilder<> &B, llvm::Value *Source, const clang::DeclaratorDecl *Decl, HLSLAppliedSemanticAttr *Semantic, llvm::dxbc::PSV::SemanticKind SemanticKind, llvm::Triple::EnvironmentType Stage, std::optional< unsigned > Index, SemanticSignatures &Signature)
llvm::Value * handleScalarSemanticLoad (llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Type *Type, const clang::DeclaratorDecl *Decl, HLSLAppliedSemanticAttr *Semantic, SemanticSignatures &Signature)
void handleScalarSemanticStore (llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Value *Source, const clang::DeclaratorDecl *Decl, HLSLAppliedSemanticAttr *Semantic, SemanticSignatures &Signature)
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, SemanticSignatures &Signature)
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, SemanticSignatures &Signature)
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, SemanticSignatures &Signature)
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, SemanticSignatures &Signature)

Protected Attributes

CodeGenModule & CGM

Detailed Description

Definition at line 119 of file CGHLSLRuntime.h.

Member Typedef Documentation

◆ SemanticSignatures

Constructor & Destructor Documentation

◆ CGHLSLRuntime()

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

Definition at line 286 of file CGHLSLRuntime.h.

References CGHLSLRuntime(), and CGM.

Referenced by CGHLSLRuntime().

◆ ~CGHLSLRuntime()

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

Definition at line 287 of file CGHLSLRuntime.h.

Member Function Documentation

◆ addBuffer()

◆ addHLSLBufferLayoutType()

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

Definition at line 977 of file CGHLSLRuntime.cpp.

References getHLSLBufferLayoutType().

◆ addRootSignature()

◆ convertHLSLSpecificType() [1/2]

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

Definition at line 291 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 780 of file CGHLSLRuntime.cpp.

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

Referenced by addBuffer(), and convertHLSLSpecificType().

◆ createBufferMatrixTempAddress()

◆ emitBufferArraySubscriptExpr()

◆ emitBufferCopy()

◆ emitBufferMemberExpr()

◆ emitEntryFunction()

◆ emitGlobalResourceArray()

◆ emitGlobalResourceArrayAsLValue()

◆ emitInitListOpaqueValues()

◆ emitResourceArraySubscriptExpr()

std::optional< LValue > CGHLSLRuntime::emitResourceArraySubscriptExpr ( const ArraySubscriptExpr * E,
CodeGenFunction & CGF )

◆ emitResourceMemberExpr()

◆ emitSystemSemanticLoad()

llvm::Value * CGHLSLRuntime::emitSystemSemanticLoad ( llvm::IRBuilder<> & B,
llvm::Type * Type,
const clang::DeclaratorDecl * Decl,
HLSLAppliedSemanticAttr * Semantic,
llvm::dxbc::PSV::SemanticKind SemanticKind,
llvm::Triple::EnvironmentType Stage,
std::optional< unsigned > Index,
SemanticSignatures & Signature )
protected

◆ emitSystemSemanticStore()

void CGHLSLRuntime::emitSystemSemanticStore ( llvm::IRBuilder<> & B,
llvm::Value * Source,
const clang::DeclaratorDecl * Decl,
HLSLAppliedSemanticAttr * Semantic,
llvm::dxbc::PSV::SemanticKind SemanticKind,
llvm::Triple::EnvironmentType Stage,
std::optional< unsigned > Index,
SemanticSignatures & Signature )
protected

Definition at line 1572 of file CGHLSLRuntime.cpp.

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

Referenced by handleScalarSemanticStore().

◆ finishCodeGen()

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [1/7]

quad_read_across_diagonal resource_getpointer resource_handlefrombinding clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( CreateHandleFromImplicitBinding ,
resource_handlefromimplicitbinding  )

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [2/7]

quad_read_across_diagonal clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( CreateResourceGetBasePointer ,
resource_getbasepointer  )

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [3/7]

quad_read_across_diagonal resource_getpointer resource_handlefrombinding resource_handlefromheap all_memory_barrier_with_group_sync clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( DeviceMemoryBarrierWithGroupSync ,
device_memory_barrier_with_group_sync  )

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [4/7]

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [5/7]

quad_read_across_diagonal resource_getpointer resource_handlefrombinding resource_handlefromheap all_memory_barrier_with_group_sync group_memory_barrier_with_group_sync clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( GetDimensionsLevelsXY ,
resource_getdimensions_levels_xy  )

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [6/7]

quad_read_across_diagonal resource_getpointer resource_handlefrombinding resource_handlefromheap clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( NonUniformResourceIndex ,
resource_nonuniformindex  )

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [7/7]

quad_read_across_diagonal resource_getpointer clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( SampleCmpLevelZero ,
resource_samplecmplevelzero  )

◆ generateGlobalCtorDtorCalls()

void CGHLSLRuntime::generateGlobalCtorDtorCalls ( )

Definition at line 1897 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 2011 of file CGHLSLRuntime.cpp.

References CGM.

Referenced by generateGlobalCtorDtorCalls().

◆ getHLSLBufferLayoutType()

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

Definition at line 970 of file CGHLSLRuntime.cpp.

Referenced by addHLSLBufferLayoutType().

◆ handleGlobalVarDefinition()

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

◆ handleScalarSemanticLoad()

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

◆ handleScalarSemanticStore()

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

◆ 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,
SemanticSignatures & Signature )
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,
SemanticSignatures & Signature )
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,
SemanticSignatures & Signature )
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,
SemanticSignatures & Signature )
protected

◆ setHLSLEntryAttributes()

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

Definition at line 1030 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: