Skip to content

Commit

Permalink
[𝘀𝗽𝗿] changes to main this commit is based on
Browse files Browse the repository at this point in the history
Created using spr 1.3.5-bogner

[skip ci]
  • Loading branch information
bogner committed Aug 14, 2024
1 parent 28d577e commit e1b20f2
Show file tree
Hide file tree
Showing 44 changed files with 1,066 additions and 494 deletions.
28 changes: 12 additions & 16 deletions llvm/docs/DirectX/DXILOpTableGenDesign.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,14 @@ properties are specified as fields of the ``DXILOp`` class as described below.
class DXILOpClass;
Concrete operation records, such as ``unary`` are defined by inheriting from ``DXILOpClass``.
6. Return type of the operation is represented as ``LLVMType``.
7. Operation arguments are represented as a list of ``LLVMType`` with each type
corresponding to the argument position. An overload type, if supported by the operation, is
denoted as the positional type ``overloadTy`` in the argument or in the result, where
``overloadTy`` is defined to be synonymous to ``llvm_any_ty``.

.. code-block::
defvar overloadTy = llvm_any_ty
Empty list, ``[]`` represents an operation with no arguments.

6. A set of type names are defined that represent return and argument types,
which all inherit from ``DXILOpParamType``. These represent simple types
like ``int32Ty``, DXIL types like ``dx.types.Handle``, and a special
``overloadTy`` which can be any type allowed by ``Overloads``, described
below.
7. Operation return type is represented as a ``DXILOpParamType``, and arguments
are represented as a list of the same. An operation with no return value
shall specify ``VoidTy`` as its return.
8. Valid operation overload types predicated on DXIL version are specified as
a list of ``Overloads`` records. Representation of ``Overloads``
class is described in a later section.
Expand Down Expand Up @@ -145,10 +141,10 @@ TableGen representations of its properties described above.
Intrinsic LLVMIntrinsic = ?;
// Result type of the op.
LLVMType result;
DXILOpParamType result;
// List of argument types of the op. Default to 0 arguments.
list<LLVMType> arguments = [];
list<DXILOpParamType> arguments = [];
// List of valid overload types predicated by DXIL version
list<Overloads> overloads;
Expand Down Expand Up @@ -233,9 +229,9 @@ overloads predicated on DXIL version as list of records of the following class

.. code-block::
class Overloads<Version minver, list<LLVMType> ols> {
class Overloads<Version minver, list<DXILOpParamType> ols> {
Version dxil_version = minver;
list<LLVMType> overload_types = ols;
list<DXILOpParamType> overload_types = ols;
}
Following is an example specification of valid overload types for ``DXIL1_0`` and
Expand Down
8 changes: 8 additions & 0 deletions llvm/include/llvm/Analysis/DXILResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class TargetExtType;
namespace dxil {

class ResourceInfo {
public:
struct ResourceBinding {
uint32_t RecordID;
uint32_t Space;
Expand Down Expand Up @@ -89,6 +90,7 @@ class ResourceInfo {
bool operator!=(const FeedbackInfo &RHS) const { return !(*this == RHS); }
};

private:
// Universal properties.
Value *Symbol;
StringRef Name;
Expand All @@ -115,6 +117,10 @@ class ResourceInfo {

MSInfo MultiSample;

// We need a default constructor if we want to insert this in a MapVector.
ResourceInfo() {}
friend class MapVector<CallInst *, ResourceInfo>;

public:
ResourceInfo(dxil::ResourceClass RC, dxil::ResourceKind Kind, Value *Symbol,
StringRef Name)
Expand Down Expand Up @@ -166,6 +172,8 @@ class ResourceInfo {
MultiSample.Count = Count;
}

dxil::ResourceClass getResourceClass() const { return RC; }

bool operator==(const ResourceInfo &RHS) const;

static ResourceInfo SRV(Value *Symbol, StringRef Name,
Expand Down
7 changes: 7 additions & 0 deletions llvm/include/llvm/IR/IntrinsicsDirectX.td
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ def int_dx_handle_fromBinding
[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i1_ty],
[IntrNoMem]>;

def int_dx_typedBufferLoad
: DefaultAttrsIntrinsic<[llvm_anyvector_ty],
[llvm_any_ty, llvm_i32_ty]>;

// Cast between target extension handle types and dxil-style opaque handles
def int_dx_cast_handle : Intrinsic<[llvm_any_ty], [llvm_any_ty]>;

def int_dx_all : DefaultAttrsIntrinsic<[llvm_i1_ty], [llvm_any_ty]>;
def int_dx_any : DefaultAttrsIntrinsic<[llvm_i1_ty], [llvm_any_ty]>;
def int_dx_clamp : DefaultAttrsIntrinsic<[llvm_any_ty], [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>]>;
Expand Down
17 changes: 0 additions & 17 deletions llvm/include/llvm/Support/DXILABI.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,6 @@
namespace llvm {
namespace dxil {

enum class ParameterKind : uint8_t {
Invalid = 0,
Void,
Half,
Float,
Double,
I1,
I8,
I16,
I32,
I64,
Overload,
CBufferRet,
ResourceRet,
DXILHandle,
};

enum class ResourceClass : uint8_t {
SRV = 0,
UAV,
Expand Down
Loading

0 comments on commit e1b20f2

Please sign in to comment.