‘pyMem’ Dialect#
A dialect representing python programs TODO
Operations#
pyMem.gcAllocFunction
(::pylir::Mem::GCAllocFunctionOp)#
Syntax:
operation ::= `pyMem.gcAllocFunction` $closure_args_types attr-dict
Allocates a function object with enough space for closure_args_types
as
closure arguments. This operation must be used over gcAllocObject
if space
must be allocated for closure_args_types
.
It is otherwise identical to gcAllocObject
.
The function object allocated is tracked by the garbage collector and guaranteed to be life as long as it is reachable.
Interfaces: InferTypeOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
closure_args_types | ::mlir::ArrayAttr | type array attribute |
Results:#
Result |
Description |
---|---|
|
python memory type |
pyMem.gcAllocObject
(::pylir::Mem::GCAllocObjectOp)#
Syntax:
operation ::= `pyMem.gcAllocObject` $type_object`[` $trailing_items `]` attr-dict
Allocates an object with the layout type and type given by the
$type_object
with $trailing_items
.
These trailing items correspond to the amount of elements in a tuple for
tuple objects, for all other objects they correspond to the amount of slots
allocated.
Items allocated by the operation are tracked by the garbage collector and guaranteed to be life as long as they are reachable.
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
index |
Results:#
Result |
Description |
---|---|
|
python memory type |
pyMem.initDict
(::pylir::Mem::InitDictOp)#
Syntax:
operation ::= `pyMem.initDict` $memory attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initFloat
(::pylir::Mem::InitFloatOp)#
Syntax:
operation ::= `pyMem.initFloat` $memory `to` $initializer attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
64-bit float |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initFunc
(::pylir::Mem::InitFuncOp)#
Syntax:
operation ::= `pyMem.initFunc` $memory `to` $initializer
(`[` $closure_args^ `:` type($closure_args) `]`)? attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
initializer | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
variadic of any type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initIntAdd
(::pylir::Mem::InitIntAddOp)#
Syntax:
operation ::= `pyMem.initIntAdd` $memory `to` $lhs `+` $rhs attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
dynamic type |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initIntSigned
(::pylir::Mem::InitIntSignedOp)#
Syntax:
operation ::= `pyMem.initIntSigned` $memory `to` $initializer attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
index |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initIntUnsigned
(::pylir::Mem::InitIntUnsignedOp)#
Syntax:
operation ::= `pyMem.initIntUnsigned` $memory `to` $initializer attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
index |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initList
(::pylir::Mem::InitListOp)#
Syntax:
operation ::= `pyMem.initList` $memory `to` ` ` `[` $initializer `]` attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
variadic of dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initObject
(::pylir::Mem::InitObjectOp)#
Syntax:
operation ::= `pyMem.initObject` $memory attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initSet
(::pylir::Mem::InitSetOp)#
Syntax:
operation ::= `pyMem.initSet` $memory `to` ` ` `{` $initializer `}` attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
variadic of dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initStr
(::pylir::Mem::InitStrOp)#
Syntax:
operation ::= `pyMem.initStr` $memory (`to` $strings^)? attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
variadic of dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initStrFromInt
(::pylir::Mem::InitStrFromIntOp)#
Syntax:
operation ::= `pyMem.initStrFromInt` $memory `to` $integer attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initTuple
(::pylir::Mem::InitTupleOp)#
Syntax:
operation ::= `pyMem.initTuple` $memory `to` ` ` `(` (`)`) : (`` $initializer^ `)`)? attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
variadic of dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initTupleCopy
(::pylir::Mem::InitTupleCopyOp)#
Syntax:
operation ::= `pyMem.initTupleCopy` $memory `to` ` ` `(` `*` $initializer `)` attr-dict
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initTupleDropFront
(::pylir::Mem::InitTupleDropFrontOp)#
Syntax:
operation ::= `pyMem.initTupleDropFront` $memory `to` ` ` $count `(` $tuple `)` attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
index |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initTupleFromList
(::pylir::Mem::InitTupleFromListOp)#
Syntax:
operation ::= `pyMem.initTupleFromList` $memory `to` ` ` `(` `*` $initializer `)` attr-dict
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initTuplePrepend
(::pylir::Mem::InitTuplePrependOp)#
Syntax:
operation ::= `pyMem.initTuplePrepend` $memory `to` ` ` `(` $element `,` $tuple `)` attr-dict
Traits: AlwaysBound
Interfaces: CaptureInterface
, InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
dynamic type |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.initType
(::pylir::Mem::InitTypeOp)#
Syntax:
operation ::= `pyMem.initType` $memory `(` `name` `=` $name `,`
`mro` `=` $mro_tuple_memory `to` $mro_tuple `,`
`slots` `=` $slots_tuple `)` attr-dict
Traits: AlwaysBound
Interfaces: InferTypeOpInterface
Operands:#
Operand |
Description |
---|---|
|
python memory type |
|
dynamic type |
|
python memory type |
|
dynamic type |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyMem.stackAllocObject
(::pylir::Mem::StackAllocObjectOp)#
Syntax:
operation ::= `pyMem.stackAllocObject` $layout $type_object`[`$trailing_items`]` attr-dict
Allocates an object with the layout given by $layout
with
$trailing_items
and the type $type_object
.
These trailing items correspond to the amount of elements in a tuple for
tuple objects, for all other objects they correspond to the amount of slots
allocated.
Due to the use of attributes for the layout and amount of trailing items, the amount of memory allocated by this operation is known ahead of time and statically allocated within a functions frame. The lifetime of this object is therefore also equal to the frame of the function call. If any references to a destroyed object still exist it is undefined behaviour.
Interfaces: CaptureInterface
, InferTypeOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
layout | pylir::Mem::LayoutTypeAttr | Enum of types with known object layouts |
trailing_items | ::mlir::IntegerAttr | index attribute |
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
python memory type |
Types#
MemoryType#
python memory type
Syntax: !pyMem.memory