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_BASE(WaveGetLaneCount
subgroup_size GENERATE_HLSL_INTRINSIC_FUNCTION (QuadReadAcrossDiagonal, quad_read_across_diagonal) GENERATE_HLSL_INTRINSIC_FUNCTION(CreateResourceGetBasePointer
subgroup_size resource_getbasepointer GENERATE_HLSL_INTRINSIC_FUNCTION (CreateResourceGetPointer, resource_getpointer) GENERATE_HLSL_INTRINSIC_FUNCTION(SampleCmpLevelZero
subgroup_size resource_getbasepointer resource_samplecmplevelzero GENERATE_HLSL_INTRINSIC_FUNCTION (CreateHandleFromBinding, resource_handlefrombinding) GENERATE_HLSL_INTRINSIC_FUNCTION(CreateHandleFromImplicitBinding
subgroup_size resource_getbasepointer resource_samplecmplevelzero resource_handlefromimplicitbinding GENERATE_HLSL_INTRINSIC_FUNCTION (CreateHandleFromHeap, resource_handlefromheap) GENERATE_HLSL_INTRINSIC_FUNCTION(NonUniformResourceIndex
subgroup_size resource_getbasepointer resource_samplecmplevelzero resource_handlefromimplicitbinding resource_nonuniformindex GENERATE_HLSL_INTRINSIC_FUNCTION (AllMemoryBarrierWithGroupSync, all_memory_barrier_with_group_sync) GENERATE_HLSL_INTRINSIC_FUNCTION(DeviceMemoryBarrierWithGroupSync
subgroup_size resource_getbasepointer resource_samplecmplevelzero resource_handlefromimplicitbinding resource_nonuniformindex device_memory_barrier_with_group_sync GENERATE_HLSL_INTRINSIC_FUNCTION (GroupMemoryBarrierWithGroupSync, group_memory_barrier_with_group_sync) llvm
llvm::Intrinsic::ID getBarrierByMemoryHandleIntrinsic ()
 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)

Public Attributes

 wave_get_lane_count

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, llvm::hlsl::InterpolationModifier Modifiers)
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, llvm::hlsl::InterpolationModifier Modifiers)
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, llvm::hlsl::InterpolationModifier Modifiers=llvm::hlsl::InterpolationModifier::None)
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, llvm::hlsl::InterpolationModifier Modifiers=llvm::hlsl::InterpolationModifier::None)

Protected Attributes

CodeGenModule & CGM

Detailed Description

Definition at line 122 of file CGHLSLRuntime.h.

Member Typedef Documentation

◆ SemanticSignatures

Constructor & Destructor Documentation

◆ CGHLSLRuntime()

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

Definition at line 307 of file CGHLSLRuntime.h.

References CGHLSLRuntime(), and CGM.

Referenced by CGHLSLRuntime().

◆ ~CGHLSLRuntime()

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

Definition at line 308 of file CGHLSLRuntime.h.

Member Function Documentation

◆ addBuffer()

◆ addHLSLBufferLayoutType()

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

Definition at line 995 of file CGHLSLRuntime.cpp.

References getHLSLBufferLayoutType().

◆ addRootSignature()

◆ convertHLSLSpecificType() [1/2]

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

Definition at line 312 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 798 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 1591 of file CGHLSLRuntime.cpp.

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

Referenced by handleScalarSemanticStore().

◆ finishCodeGen()

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [1/8]

subgroup_size resource_getbasepointer resource_samplecmplevelzero resource_handlefromimplicitbinding resource_nonuniformindex clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( AllMemoryBarrierWithGroupSync ,
all_memory_barrier_with_group_sync  )

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [2/8]

subgroup_size resource_getbasepointer resource_samplecmplevelzero clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( CreateHandleFromBinding ,
resource_handlefrombinding  )

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [3/8]

subgroup_size resource_getbasepointer resource_samplecmplevelzero resource_handlefromimplicitbinding clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( CreateHandleFromHeap ,
resource_handlefromheap  )

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [4/8]

subgroup_size resource_getbasepointer clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( CreateResourceGetPointer ,
resource_getpointer  )

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [5/8]

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [6/8]

clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( GetDimensionsLevelsXY ,
resource_getdimensions_levels_xy  )

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [7/8]

subgroup_size resource_getbasepointer resource_samplecmplevelzero resource_handlefromimplicitbinding resource_nonuniformindex device_memory_barrier_with_group_sync clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( GroupMemoryBarrierWithGroupSync ,
group_memory_barrier_with_group_sync  )
inline

Definition at line 207 of file CGHLSLRuntime.h.

References GENERATE_HLSL_INTRINSIC_FUNCTION().

◆ GENERATE_HLSL_INTRINSIC_FUNCTION() [8/8]

subgroup_size clang::CodeGen::CGHLSLRuntime::GENERATE_HLSL_INTRINSIC_FUNCTION ( QuadReadAcrossDiagonal ,
quad_read_across_diagonal  )

◆ generateGlobalCtorDtorCalls()

void CGHLSLRuntime::generateGlobalCtorDtorCalls ( )

Definition at line 1978 of file CGHLSLRuntime.cpp.

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

Referenced by finishCodeGen().

◆ getBarrierByMemoryHandleIntrinsic()

llvm::Intrinsic::ID clang::CodeGen::CGHLSLRuntime::getBarrierByMemoryHandleIntrinsic ( )
inline

Definition at line 214 of file CGHLSLRuntime.h.

◆ getConvergenceToken()

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

Definition at line 2092 of file CGHLSLRuntime.cpp.

References CGM.

Referenced by generateGlobalCtorDtorCalls().

◆ getHLSLBufferLayoutType()

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

Definition at line 988 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,
llvm::hlsl::InterpolationModifier Modifiers = llvm::hlsl::InterpolationModifier::None )
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,
llvm::hlsl::InterpolationModifier Modifiers = llvm::hlsl::InterpolationModifier::None )
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,
llvm::hlsl::InterpolationModifier Modifiers )
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,
llvm::hlsl::InterpolationModifier Modifiers )
protected

◆ setHLSLEntryAttributes()

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

Definition at line 1048 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

◆ wave_get_lane_count

clang::CodeGen::CGHLSLRuntime::wave_get_lane_count

Definition at line 159 of file CGHLSLRuntime.h.


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