LLVM 24.0.0git
DXILResource.cpp File Reference
#include "llvm/Analysis/DXILResource.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IntrinsicsDirectX.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/DXILABI.h"
#include "llvm/Support/FormatVariadic.h"
#include <cstdint>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "dxil-resource"

Functions

static StringRef getResourceKindName (ResourceKind RK)
static StringRef getElementTypeName (ElementType ET)
static StringRef getElementTypeNameForTemplate (ElementType ET)
static StringRef getSamplerTypeName (SamplerType ST)
static StringRef getSamplerFeedbackTypeName (SamplerFeedbackType SFT)
static dxil::ElementType toDXILElementType (Type *Ty, bool IsSigned)
static dxil::ElementType toDXILStorageType (dxil::ElementType ET)
static void formatTypeName (SmallString< 64 > &Dest, StringRef Name, bool IsWriteable, bool IsROV, Type *ContainedType=nullptr, bool IsSigned=true)
static StructTypegetOrCreateElementStruct (Type *ElemType, StringRef Name)
static TypegetTypeWithoutPadding (Type *Ty)
static bool isROV (dxil::ResourceKind Kind, TargetExtType *Ty)
static std::pair< Type *, boolgetTypedElementType (dxil::ResourceKind Kind, TargetExtType *Ty)
static ValuefindResourceHandleFromPointer (Value *Ptr)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "dxil-resource"

Definition at line 29 of file DXILResource.cpp.

Function Documentation

◆ findResourceHandleFromPointer()

Value * findResourceHandleFromPointer ( Value * Ptr)
static

Definition at line 947 of file DXILResource.cpp.

References llvm::dyn_cast(), GEP, II, and llvm::Value::stripPointerCasts().

◆ formatTypeName()

void formatTypeName ( SmallString< 64 > & Dest,
StringRef Name,
bool IsWriteable,
bool IsROV,
Type * ContainedType = nullptr,
bool IsSigned = true )
static

◆ getElementTypeName()

StringRef getElementTypeName ( ElementType ET)
static

Definition at line 79 of file DXILResource.cpp.

References llvm_unreachable.

Referenced by llvm::dxil::ResourceTypeInfo::print().

◆ getElementTypeNameForTemplate()

StringRef getElementTypeNameForTemplate ( ElementType ET)
static

Definition at line 123 of file DXILResource.cpp.

References llvm_unreachable.

Referenced by formatTypeName().

◆ getOrCreateElementStruct()

StructType * getOrCreateElementStruct ( Type * ElemType,
StringRef Name )
static

◆ getResourceKindName()

StringRef getResourceKindName ( ResourceKind RK)
static

◆ getSamplerFeedbackTypeName()

StringRef getSamplerFeedbackTypeName ( SamplerFeedbackType SFT)
static

Definition at line 173 of file DXILResource.cpp.

References llvm_unreachable.

Referenced by llvm::dxil::ResourceTypeInfo::print().

◆ getSamplerTypeName()

StringRef getSamplerTypeName ( SamplerType ST)
static

Definition at line 161 of file DXILResource.cpp.

References llvm_unreachable.

Referenced by llvm::dxil::ResourceTypeInfo::print().

◆ getTypedElementType()

◆ getTypeWithoutPadding()

◆ isROV()

◆ toDXILElementType()

dxil::ElementType toDXILElementType ( Type * Ty,
bool IsSigned )
static

Definition at line 183 of file DXILResource.cpp.

Referenced by formatTypeName(), and llvm::dxil::ResourceTypeInfo::getTyped().

◆ toDXILStorageType()