Crate spirt

Source
Expand description

§SPIR-🇹

⋯🢒 🇹arget 🠆 🇹ransform 🠆 🇹ranslate ⋯🢒


SPIR-🇹 is a research project aimed at exploring shader-oriented IR designs derived from SPIR-V, and producing a framework around such an IR to facilitate advanced compilation pipelines, beyond what existing SPIR-V tooling allows for.

🚧 This project is in active design and development, many details can and will change 🚧

spirt 0.4.0’s README
    (click through for the full version)

Check out also the rust-gpu/spirt GitHub repository, for any additional developments.

§Notable types/modules
§IR data types
§Utilities and passes

Modules§

cfg
Control-flow graph (CFG) abstractions and utilities.
cfgssa
Tools for working with control-flow graphs that contain SSA dataflow (often abbreviated to CFG<SSA> or similar).
context 🔒
Context and related types/traits.
func_at
Traversal helpers for intra-function entities.
passes
IR transformations (typically whole-Module).
print
Pretty-printing anything in the IR, from whole Modules to their leaves.
qptr
QPtr-related type definitions and passes.
spv
SPIR-V support, mainly conversions to/from SPIR-T (lower/lift).
transform
Mutable IR traversal.
visit
Immutable IR traversal.

Structs§

AttrSet
Interned handle for an AttrSetDef (a set of Attrs).
AttrSetDef
Definition for an AttrSet: a set of Attrs.
Const
Interned handle for a ConstDef (a constant value).
ConstDef
Definition for a Const: a constant value.
Context
Context object with global resources for SPIR-T.
ControlNode
Entity handle for a ControlNodeDef (a control-flow operator or leaf).
ControlNodeDef
Definition for a ControlNode: a control-flow operator or leaf.
ControlNodeOutputDecl
ControlRegion
Entity handle for a ControlRegionDef (a control-flow region).
ControlRegionDef
Definition for a ControlRegion: a control-flow region.
ControlRegionInputDecl
DataInst
Entity handle for a DataInstDef (a leaf instruction).
DataInstDef
Definition for a DataInst: a leaf (non-control-flow) instruction.
DataInstForm
Interned handle for a DataInstFormDef (a “form”, or “template”, for DataInstDefs).
DataInstFormDef
“Form” (or “template”) definition for DataInstFormDefs, which includes most of their common static information (notably excluding attrs, as they vary more often due to handling diagnostics, debuginfo, refinement etc.).
Diag
Diagnostics produced by SPIR-T passes, and recorded in Attr::Diagnostics.
EntityDefs
Collection holding the actual definitions for Context-allocated entities.
EntityList
Doubly-linked list, “intrusively” going through E::Def, which must be an EntityListNode<E, _> (to hold the “previous/next node” links).
EntityListIter
EntityList<E> iterator, but with a different API than Iterator.
EntityOrientedDenseMap
Map with K keys and V values, that is:
Func
Entity handle for a FuncDecl (a function).
FuncDecl
Declaration/definition for a Func: a function.
FuncDefBody
The body of a Func definition.
FuncParam
GlobalVar
Entity handle for a GlobalVarDecl (a global variable).
GlobalVarDecl
Declaration/definition for a GlobalVar: a global variable.
GlobalVarDefBody
The body of a GlobalVar definition.
InternedStr
Interned handle for a str.
Module
OrdAssertEq
Wrapper to limit Ord for interned index types (e.g. InternedStr) to only situations where the interned index reflects contents (i.e. equality).
Type
Interned handle for a TypeDef.
TypeDef
Definition for a Type.

Enums§

AddrSpace
Attr
Any semantic or non-semantic (debuginfo) decoration/modifier, that can be optionally applied to some declaration/definition.
ConstKind
ControlNodeKind
DataInstKind
DeclDef
Declarations (GlobalVarDecl, FuncDecl) can contain a full definition, or only be an import of a definition (e.g. from another module).
DiagLevel
The “severity” level of a Diagnostic.
DiagMsgPart
One part of a Diagnostic message, allowing rich interpolation.
ExportKey
An unique identifier (e.g. a link name, or “symbol”) for a module export.
Exportee
A definition exported out of a module (see also ExportKey).
Import
An identifier (e.g. a link name, or “symbol”) for an import declaration.
ModuleDebugInfo
Non-semantic details (i.e. debuginfo) of a SPIR-Y module (not tied to any declarations/definitions).
ModuleDialect
Semantic properties of a SPIR-T module (not tied to any declarations/definitions).
SelectionKind
TypeKind
TypeOrConst
Value

Traits§

EntityOrientedMapKey
EntityOriented*Map<Self, V> support trait, implemented for entity types, but which can also be implemented by users for their own newtypes and other types wrapping entity types (such as finite enums).