Skip to content

'll' Dialect

A vast low-level dialect. This dialect serves as a bottom layer in VAST dialect tower. There should always exist a pass that lowers this dialect into LLVM Dialect.

Work in progress - new operations are still being added and existing can be changed or removed.

Operations

ll.alloca (::vast::ll::Alloca)

Alloca for a piece of memory. For now does not support array types.

Syntax:

operation ::= `ll.alloca` attr-dict `:` type($result)

Results:

Result Description
result any type

ll.br (::vast::ll::Br)

Direct branch.

Syntax:

operation ::= `ll.br` $dest (`(` $operands^ `:` type($operands) `)`)? attr-dict

Direct branch Traits: Terminator

Interfaces: BranchOpInterface

Operands:

Operand Description
operands variadic of any type

Successors:

Successor Description
dest any successor

ll.cell (::vast::ll::Cell)

Cell that holds the value and is accessible trhough SSA result.

Syntax:

operation ::= `ll.cell` $sym_name attr-dict custom< StorageClasses >($storageClass, $threadStorageClass)
              `:` type($result)

Interfaces: Core_DeclStorageInterface, Core_Symbol, Core_VarSymbol, DeclStorageInterface

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute
storageClass::vast::core::StorageClassAttrdeclaration storage class
threadStorageClass::vast::core::TSClassAttrdeclaration storage class

Results:

Result Description
result any type

ll.cell_init (::vast::ll::CellInit)

Cell initialization.

Syntax:

operation ::= `ll.cell_init` operands attr-dict `:` functional-type(operands, results)

Operands:

Operand Description
var any type
elements variadic of any type

Results:

Result Description
result any type

ll.concat (::vast::ll::Concat)

Concat integers together

Syntax:

operation ::= `ll.concat` operands attr-dict `:` functional-type(operands, results)

Concat operands together, where first argument occupies lsb.

Operands:

Operand Description
args variadic of any type

Results:

Result Description
result any type

ll.cond_br (::vast::ll::CondBr)

Conditional branch.

Syntax:

operation ::= `ll.cond_br` $cond `:` type($cond) `,`
              $trueDest (`(` $trueOperands^ `:` type($trueOperands) `)`)? `,`
              $falseDest (`(` $falseOperands^ `:` type($falseOperands) `)`)?
              attr-dict

Direct branch Traits: AttrSizedOperandSegments, Terminator

Operands:

Operand Description
cond any type
trueOperands variadic of any type
falseOperands variadic of any type

Successors:

Successor Description
trueDest any successor
falseDest any successor

ll.cond_scope_ret (::vast::ll::CondScopeRet)

Terminator of scope if condition is met, otherwise branch.

Syntax:

operation ::= `ll.cond_scope_ret` $cond `:` type($cond) `,`
              $dest (`(` $dest_operands^ `:` type($dest_operands) `)`)? attr-dict

Terminate or branch. Traits: Terminator

Operands:

Operand Description
cond any type
dest_operands variadic of any type

Successors:

Successor Description
dest any successor

ll.extract (::vast::ll::Extract)

Extracts value

Syntax:

operation ::= `ll.extract` operands attr-dict `:` functional-type(operands, results)

0 is lsb, [inc, exc)

Attributes:

AttributeMLIR TypeDescription
from::mlir::TypedAttrTypedAttr instance
to::mlir::TypedAttrTypedAttr instance

Operands:

Operand Description
arg any type

Results:

Result Description
result any type

ll.func (::vast::ll::FuncOp)

VAST function template

Syntax:

operation ::= `ll.func` $sym_name custom< FunctionSignatureAndBody >($function_type, attr-dict, $body)

Inspired by cir::FuncOp and mlir::func::FuncOp:

Operations within the function cannot implicitly capture values defined outside of the function, i.e. Functions are IsolatedFromAbove. All external references must use function arguments or attributes that establish a symbolic connection (e.g. symbols referenced by name via a string attribute like SymbolRefAttr). An external function declaration (used when referring to a function declared in some other module) has no body.

The function linkage information is specified by linkage, as defined by GlobalLinkageKind attribute.

Traits: AutomaticAllocationScope, IsolatedFromAbove, NoTerminator, ShadowingSymbolTable

Interfaces: CallableOpInterface, Core_FuncSymbol, Core_FunctionOpInterface, Core_SymbolTableOpInterface, Core_Symbol

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute
function_type::mlir::TypeAttrtype attribute of function type
linkage::vast::core::GlobalLinkageKindAttrglobal linkage kind
sym_visibility::mlir::StringAttrstring attribute
arg_attrs::mlir::ArrayAttrArray of dictionary attributes
res_attrs::mlir::ArrayAttrArray of dictionary attributes

ll.gep (::vast::ll::StructGEPOp)

VAST struct gep operation

VAST struct gep operation

Attributes:

AttributeMLIR TypeDescription
idx::mlir::IntegerAttr32-bit signless integer attribute
field::mlir::FlatSymbolRefAttrflat symbol reference attribute

Operands:

Operand Description
record any type

Results:

Result Description
element any type

ll.initialize (::vast::ll::InitializeVar)

Initialize a variable.

Syntax:

operation ::= `ll.initialize` operands attr-dict `:` functional-type(operands, results)

Initialize a variable - for now this operation is a direct lowering from hl.var initialization section. Later there will be need to discover how this ties to constructors.

Operands:

Operand Description
var any type
elements variadic of any type

Results:

Result Description
result any type

ll.inline_scope (::vast::ll::InlineScope)

Scope, that forwards (cond)scope return up.

Result of inlined if. Traits: NoRegionArguments

ll.load (::vast::ll::Load)

Load value from memory. Expects hl.ptr as pointer type.

Syntax:

operation ::= `ll.load` operands attr-dict `:` functional-type(operands, results)

Interfaces: InferTypeOpInterface

Operands:

Operand Description
ptr ElementTypeInterface instance

Results:

Result Description
result any type

ll.return (::vast::ll::ReturnOp)

Syntax:

operation ::= `ll.return` ($result^ `:` type($result))? attr-dict

Traits: Core_ReturnLikeTrait, Terminator

Operands:

Operand Description
result variadic of any type

ll.scope (::vast::ll::Scope)

Scope, holds one region.

Syntax:

operation ::= `ll.scope` $body attr-dict

Scope that holds one region, each block should be terminated with either branch, scope return or their conditional variants. Traits: Core_ScopeLikeTrait, NoRegionArguments, NoTerminator, ShadowingSymbolTable

Interfaces: Core_SymbolTableOpInterface

ll.scope_recurse (::vast::ll::ScopeRecurse)

Jump to first block of scope.

Syntax:

operation ::= `ll.scope_recurse` attr-dict

Modelling continue. Traits: Terminator

ll.scope_ret (::vast::ll::ScopeRet)

Terminator of scope.

Syntax:

operation ::= `ll.scope_ret` attr-dict

Terminator of scopes (for example during lowering of loops). Traits: Terminator

ll.store (::vast::ll::Store)

Store value into memory. Expects hl.ptr as pointer type.

Syntax:

operation ::= `ll.store` $ptr `,` $val attr-dict `:` type($ptr) `,` type($val)

Operands:

Operand Description
val any type
ptr ElementTypeInterface instance

ll.subscript (::vast::ll::Subscript)

VAST array subscript operator

Syntax:

operation ::= `ll.subscript` $array `at` ` ` `[` $index `:` type($index) `]` attr-dict
              `:` type($array) `->` type($result)

VAST array subscript operator

Operands:

Operand Description
array any type
index any type

Results:

Result Description
result any type

ll.uninitialized_var (::vast::ll::UninitializedVar)

Declaration of variable that have not been initialized yet.

Syntax:

operation ::= `ll.uninitialized_var` attr-dict `:` type($result)

Declaration of variable that have not been initialized yet. Interfaces: Core_Symbol, Core_VarSymbol

Results:

Result Description
result any type