IR Data Structures
Attribute
Attributes represent compile-time information in xDSL. All attributes are immutable, equatable, and hashable.
SSAValue
Run-time information is represented as SSAValue. SSA stands for static single-assignment, meaning that each value is only ever assigned once, and never reassigned. This property is useful when performing transformations such as dead-code elimination, constant folding, and other compiler transformations.
IRNode
Code is represented as a recursive data structure, where operations contain a doubly-linked list of regions, which contain a doubly linked list of blocks, which contain operations.
Operation
Operations are rich objects that carry some meaning in their IR.
They can be used to represent integer addition (arith.addi
), a module of code (builtin.module
), a function declaration or definition (func.func
), and many more.
Block
Blocks are a list of operations. They have a (possibly empty) list of operands, that can be used to model function arguments for use in the function body, or loop arguments.
Region
Regions are a list of blocks.
Dialect
A dialect is a grouping of attributes and operations.