‘pyHIR’ Dialect#
Dialect for a high level representation of python operations. This dialect is meant as an entry point into MLIR and as the lowering target from the frontend. It aims to preserve the high level semantics and operations present in python source code and only later lower to “python mandated implementation details” operating on low level object operations (see ‘py’ Dialect).
Operations#
pyHIR.binAssignOp
(::pylir::HIR::BinAssignOp)#
Syntax:
operation ::= `pyHIR.binAssignOp` $lhs $binaryAssignment $rhs attr-dict
Operation representing compound assignment operators in python.
Traits: AddableExceptionHandling<BinAssignExOp>
Interfaces: InferTypeOpInterface
, pylir::HIR::BinAssignOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
binaryAssignment | pylir::HIR::BinaryAssignmentAttr | Binary assignment operations in python |
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyHIR.binAssignOpEx
(::pylir::HIR::BinAssignExOp)#
Exception-handling variant of pyHIR.binAssignOp
Syntax:
operation ::= `pyHIR.binAssignOpEx` $lhs $binaryAssignment $rhs attr-dict
`\n` ` ` ` `
`label` $happy_path ( `(` $normal_dest_operands^ `:` type($normal_dest_operands) `)`)?
`unwind` $exception_path ( `(` $unwind_dest_operands^ `:` type($unwind_dest_operands) `)`)?
Traits: AttrSizedOperandSegments
, Terminator
Interfaces: BranchOpInterface
, ExceptionHandlingInterface
, InferTypeOpInterface
, pylir::HIR::BinAssignOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
binaryAssignment | pylir::HIR::BinaryAssignmentAttr | Binary assignment operations in python |
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
|
variadic of any type |
|
variadic of any type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
Successors:#
Successor |
Description |
---|---|
|
any successor |
|
any successor |
pyHIR.binOp
(::pylir::HIR::BinOp)#
Syntax:
operation ::= `pyHIR.binOp` $lhs $binaryOperation $rhs attr-dict
Operation representing a reversible binary operator in python.
Traits: AddableExceptionHandling<BinExOp>
Interfaces: InferTypeOpInterface
, pylir::HIR::BinOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
binaryOperation | pylir::HIR::BinaryOperationAttr | Binary operations in python |
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyHIR.binOpEx
(::pylir::HIR::BinExOp)#
Exception-handling variant of pyHIR.binOp
Syntax:
operation ::= `pyHIR.binOpEx` $lhs $binaryOperation $rhs attr-dict
`\n` ` ` ` `
`label` $happy_path ( `(` $normal_dest_operands^ `:` type($normal_dest_operands) `)`)?
`unwind` $exception_path ( `(` $unwind_dest_operands^ `:` type($unwind_dest_operands) `)`)?
Traits: AttrSizedOperandSegments
, Terminator
Interfaces: BranchOpInterface
, ExceptionHandlingInterface
, InferTypeOpInterface
, pylir::HIR::BinOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
binaryOperation | pylir::HIR::BinaryOperationAttr | Binary operations in python |
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
|
variadic of any type |
|
variadic of any type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
Successors:#
Successor |
Description |
---|---|
|
any successor |
|
any successor |
pyHIR.buildClass
(::pylir::HIR::BuildClassOp)#
Syntax:
operation ::= `pyHIR.buildClass` `(` $function `,` $name (`,`
custom<CallArguments>($keywords,
$arguments,
$kind_internal)^ )? `)` attr-dict-with-keyword
Op corresponding to CPython’s internal __build_class__
function.
Creates a new type instance with the given name and initializes its
dictionary by calling function
using a dictionary that must be modified
in-place.
The base-class list is derived from all positional arguments.
The keyword arguments, with the exception of the key "metaclass"
, are
passed to various methods during class creation.
TODO
Describe the the class creation procedure in detail.
Traits: AddableExceptionHandling<BuildClassExOp, ::pylir::Py::OperandShape::Single, ::pylir::Py::OperandShape::Variadic>
Interfaces: InferTypeOpInterface
, PylirHIR_CallInterface
, pylir::HIR::BuildClassOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
name | ::mlir::StringAttr | string attribute |
keywords | ::mlir::ArrayAttr | string array attribute |
kind_internal | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
variadic of dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyHIR.buildClassEx
(::pylir::HIR::BuildClassExOp)#
Exception-handling variant of pyHIR.buildClass
Syntax:
operation ::= `pyHIR.buildClassEx` `(` $function `,` $name (`,`
custom<CallArguments>($keywords,
$arguments,
$kind_internal)^ )? `)` attr-dict-with-keyword
`\n` ` ` ` `
`label` $happy_path ( `(` $normal_dest_operands^ `:` type($normal_dest_operands) `)`)?
`unwind` $exception_path ( `(` $unwind_dest_operands^ `:` type($unwind_dest_operands) `)`)?
Traits: AttrSizedOperandSegments
, Terminator
Interfaces: BranchOpInterface
, ExceptionHandlingInterface
, InferTypeOpInterface
, PylirHIR_CallInterface
, pylir::HIR::BuildClassOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
name | ::mlir::StringAttr | string attribute |
keywords | ::mlir::ArrayAttr | string array attribute |
kind_internal | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
variadic of dynamic type |
|
variadic of any type |
|
variadic of any type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
Successors:#
Successor |
Description |
---|---|
|
any successor |
|
any successor |
pyHIR.call
(::pylir::HIR::CallOp)#
Syntax:
operation ::= `pyHIR.call` $callable `(` (`)`) : ( ``
custom<CallArguments>($keywords,
$arguments,
$kind_internal)^ `)` )? attr-dict
Operation representing a call operation in Python.
TODO: Explain call resolution.
Syntax:
arg ::= [`*` | `**` | string-attr `=`] value-use
global_func ::= `pyHIR.call` value-use `(` [ <arg> { `,` <arg> } ] `)`
Traits: AddableExceptionHandling<CallExOp, ::pylir::Py::OperandShape::Single, ::pylir::Py::OperandShape::Variadic>
Interfaces: InferTypeOpInterface
, PylirHIR_CallInterface
, pylir::HIR::CallOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
keywords | ::mlir::ArrayAttr | string array attribute |
kind_internal | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
variadic of dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyHIR.callEx
(::pylir::HIR::CallExOp)#
Exception-handling variant of pyHIR.call
Syntax:
operation ::= `pyHIR.callEx` $callable `(` (`)`) : ( ``
custom<CallArguments>($keywords,
$arguments,
$kind_internal)^ `)` )? attr-dict
`\n` ` ` ` `
`label` $happy_path ( `(` $normal_dest_operands^ `:` type($normal_dest_operands) `)`)?
`unwind` $exception_path ( `(` $unwind_dest_operands^ `:` type($unwind_dest_operands) `)`)?
Traits: AttrSizedOperandSegments
, Terminator
Interfaces: BranchOpInterface
, ExceptionHandlingInterface
, InferTypeOpInterface
, PylirHIR_CallInterface
, pylir::HIR::CallOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
keywords | ::mlir::ArrayAttr | string array attribute |
kind_internal | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
variadic of dynamic type |
|
variadic of any type |
|
variadic of any type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
Successors:#
Successor |
Description |
---|---|
|
any successor |
|
any successor |
pyHIR.class
(::pylir::HIR::ClassOp)#
Syntax:
operation ::= `pyHIR.class` $name ( `(`
custom<CallArguments>($keywords,
$arguments,
$kind_internal)^ `)` )? attr-dict-with-keyword
$body
Traits: AddableExceptionHandling<ClassExOp>
Interfaces: InferTypeOpInterface
, OpAsmOpInterface
, PylirHIR_CallInterface
, pylir::HIR::ClassOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
name | ::mlir::StringAttr | string attribute |
keywords | ::mlir::ArrayAttr | string array attribute |
kind_internal | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
Operands:#
Operand |
Description |
---|---|
|
variadic of dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyHIR.class_return
(::pylir::HIR::ClassReturnOp)#
Syntax:
operation ::= `pyHIR.class_return` attr-dict
Op used to terminate a pyHIR.class
body.
Traits: AlwaysSpeculatableImplTrait
, HasParent<ClassOp, ClassExOp>
, ReturnLike
, Terminator
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
, RegionBranchTerminatorOpInterface
Effects: MemoryEffects::Effect{}
pyHIR.classEx
(::pylir::HIR::ClassExOp)#
Exception-handling variant of pyHIR.class
Syntax:
operation ::= `pyHIR.classEx` $name ( `(`
custom<CallArguments>($keywords,
$arguments,
$kind_internal)^ `)` )? attr-dict-with-keyword
$body
`label` $happy_path ( `(` $normal_dest_operands^ `:` type($normal_dest_operands) `)`)?
`unwind` $exception_path ( `(` $unwind_dest_operands^ `:` type($unwind_dest_operands) `)`)?
Traits: AttrSizedOperandSegments
, Terminator
Interfaces: BranchOpInterface
, ExceptionHandlingInterface
, InferTypeOpInterface
, OpAsmOpInterface
, PylirHIR_CallInterface
, pylir::HIR::ClassOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
name | ::mlir::StringAttr | string attribute |
keywords | ::mlir::ArrayAttr | string array attribute |
kind_internal | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
Operands:#
Operand |
Description |
---|---|
|
variadic of dynamic type |
|
variadic of any type |
|
variadic of any type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
Successors:#
Successor |
Description |
---|---|
|
any successor |
|
any successor |
pyHIR.contains
(::pylir::HIR::ContainsOp)#
Syntax:
operation ::= `pyHIR.contains` $item `in` $container attr-dict
Performs a membership check whether item
is within container
.
This is performed in the following steps:
If the type of
container
implements__contains__
, calls the method withitem
. Returns true if it returns a truthy value.Otherwise, if the type of
container
implements__iter__
, it iterates overcontainer
and checks whether for any elementz
,z is item or z == item
is true. Any exceptions raised in the process are propagated as is.
TODO
Describe the behaviour of types implementing
__getitem__
in detail.Implement correctly in lowering: Currently only performs
__contains__
check.
Reference: https://docs.python.org/3.9/reference/expressions.html#membership-test-operations
Traits: AddableExceptionHandling<ContainsExOp>
Interfaces: InferTypeOpInterface
, pylir::HIR::ContainsOpInterface
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyHIR.containsEx
(::pylir::HIR::ContainsExOp)#
Exception-handling variant of pyHIR.contains
Syntax:
operation ::= `pyHIR.containsEx` $item `in` $container attr-dict
`\n` ` ` ` `
`label` $happy_path ( `(` $normal_dest_operands^ `:` type($normal_dest_operands) `)`)?
`unwind` $exception_path ( `(` $unwind_dest_operands^ `:` type($unwind_dest_operands) `)`)?
Traits: AttrSizedOperandSegments
, Terminator
Interfaces: BranchOpInterface
, ExceptionHandlingInterface
, InferTypeOpInterface
, pylir::HIR::ContainsOpInterface
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
|
variadic of any type |
|
variadic of any type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
Successors:#
Successor |
Description |
---|---|
|
any successor |
|
any successor |
pyHIR.delItem
(::pylir::HIR::DelItemOp)#
Syntax:
operation ::= `pyHIR.delItem` $object `[` $index `]` attr-dict
Traits: AddableExceptionHandling<DelItemExOp>
Interfaces: InferTypeOpInterface
, pylir::HIR::DelItemOpInterface
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyHIR.delItemEx
(::pylir::HIR::DelItemExOp)#
Exception-handling variant of pyHIR.delItem
Syntax:
operation ::= `pyHIR.delItemEx` $object `[` $index `]` attr-dict
`\n` ` ` ` `
`label` $happy_path ( `(` $normal_dest_operands^ `:` type($normal_dest_operands) `)`)?
`unwind` $exception_path ( `(` $unwind_dest_operands^ `:` type($unwind_dest_operands) `)`)?
Traits: AttrSizedOperandSegments
, Terminator
Interfaces: BranchOpInterface
, ExceptionHandlingInterface
, InferTypeOpInterface
, pylir::HIR::DelItemOpInterface
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
|
variadic of any type |
|
variadic of any type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
Successors:#
Successor |
Description |
---|---|
|
any successor |
|
any successor |
pyHIR.func
(::pylir::HIR::FuncOp)#
Op representing a python function object. This defines a function with a given name and parameters containing all semantically relevant python constructs such as parameter names, default values, positional and keyword rest arguments etc.
It returns a new python function object as value representing the function.
It is not marked IsolatedFromAbove
allowing the use and import of
nonlocal
variables in the function body.
Syntax:
arg ::= (`*` | `**`) value-def [[`only`] string-attr] [ `=` value-use ] [ dictionary-attr ]
global_func ::= `pyHIR.func` name `(` [ <arg> { `,` <arg> } ] `)` [ `->` dictionary-attr ] attr-with-keyword
`{` body `}`
Traits: EntryArgsBound
Interfaces: CallableOpInterface
, InferTypeOpInterface
, OpAsmOpInterface
, PylirHIR_FunctionInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
name | ::mlir::StringAttr | string attribute |
default_values_mapping | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
function_type | ::mlir::TypeAttr | type attribute of python function |
arg_attrs | ::mlir::ArrayAttr | Array of dictionary attributes |
res_attrs | ::mlir::ArrayAttr | Array of dictionary attributes |
parameter_names | ::mlir::ArrayAttr | string array attribute |
parameter_name_mapping | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
keyword_only_mapping | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
pos_rest | ::mlir::IntegerAttr | 32-bit signless integer attribute |
keyword_rest | ::mlir::IntegerAttr | 32-bit signless integer attribute |
Operands:#
Operand |
Description |
---|---|
|
variadic of dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyHIR.getAttribute
(::pylir::HIR::GetAttributeOp)#
Syntax:
operation ::= `pyHIR.getAttribute` $attribute `of` $object attr-dict
Traits: AddableExceptionHandling<GetAttributeExOp>
Interfaces: InferTypeOpInterface
, pylir::HIR::GetAttributeOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
attribute | ::mlir::StringAttr | string attribute |
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyHIR.getAttributeEx
(::pylir::HIR::GetAttributeExOp)#
Exception-handling variant of pyHIR.getAttribute
Syntax:
operation ::= `pyHIR.getAttributeEx` $attribute `of` $object attr-dict
`\n` ` ` ` `
`label` $happy_path ( `(` $normal_dest_operands^ `:` type($normal_dest_operands) `)`)?
`unwind` $exception_path ( `(` $unwind_dest_operands^ `:` type($unwind_dest_operands) `)`)?
Traits: AttrSizedOperandSegments
, Terminator
Interfaces: BranchOpInterface
, ExceptionHandlingInterface
, InferTypeOpInterface
, pylir::HIR::GetAttributeOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
attribute | ::mlir::StringAttr | string attribute |
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
variadic of any type |
|
variadic of any type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
Successors:#
Successor |
Description |
---|---|
|
any successor |
|
any successor |
pyHIR.getItem
(::pylir::HIR::GetItemOp)#
Syntax:
operation ::= `pyHIR.getItem` $object `[` $index `]` attr-dict
Traits: AddableExceptionHandling<GetItemExOp>
Interfaces: InferTypeOpInterface
, pylir::HIR::GetItemOpInterface
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyHIR.getItemEx
(::pylir::HIR::GetItemExOp)#
Exception-handling variant of pyHIR.getItem
Syntax:
operation ::= `pyHIR.getItemEx` $object `[` $index `]` attr-dict
`\n` ` ` ` `
`label` $happy_path ( `(` $normal_dest_operands^ `:` type($normal_dest_operands) `)`)?
`unwind` $exception_path ( `(` $unwind_dest_operands^ `:` type($unwind_dest_operands) `)`)?
Traits: AttrSizedOperandSegments
, Terminator
Interfaces: BranchOpInterface
, ExceptionHandlingInterface
, InferTypeOpInterface
, pylir::HIR::GetItemOpInterface
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
|
variadic of any type |
|
variadic of any type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
Successors:#
Successor |
Description |
---|---|
|
any successor |
|
any successor |
pyHIR.globalFunc
(::pylir::HIR::GlobalFuncOp)#
Op representing a function in global scope with no use of non-local
variables or similar.
This is meant as a more restrictive and more optimized form of pyHIR.func
.
Unlike pyHIR.func
, pyHIR.globalFunc
must have a first parameter which
acts as the closure parameter used to implement non-local variables after
outlining.
It may not have a default parameter nor a keyword with which it can be
called.
Syntax:
arg ::= (`*` | `**`) value-def [[`only`] string-attr] [`has_default`] [ dictionary-attr ]
global_func ::= `pyHIR.global_func` sym_name `(` [ <arg> { `,` <arg> } ] `)` [ `->` dictionary-attr ] attr-with-keyword
`{` body `}`
Traits: EntryArgsBound
, IsolatedFromAbove
Interfaces: CallableOpInterface
, FunctionOpInterface
, OpAsmOpInterface
, PylirHIR_FunctionInterface
, Symbol
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
default_values_mapping | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
function_type | ::mlir::TypeAttr | type attribute of python function |
arg_attrs | ::mlir::ArrayAttr | Array of dictionary attributes |
res_attrs | ::mlir::ArrayAttr | Array of dictionary attributes |
parameter_names | ::mlir::ArrayAttr | string array attribute |
parameter_name_mapping | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
keyword_only_mapping | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
pos_rest | ::mlir::IntegerAttr | 32-bit signless integer attribute |
keyword_rest | ::mlir::IntegerAttr | 32-bit signless integer attribute |
pyHIR.init
(::pylir::HIR::InitOp)#
Syntax:
operation ::= `pyHIR.init` $sym_name attr-dict-with-keyword $body
This op represents the initializer body of a module $name
, or in other
words, the global scope of a python source file.
Traits: IsolatedFromAbove
, NoRegionArguments
Interfaces: OpAsmOpInterface
, Symbol
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
pyHIR.init_return
(::pylir::HIR::InitReturnOp)#
Syntax:
operation ::= `pyHIR.init_return` attr-dict
Op used to terminate a pyHIR.init
body.
Traits: AlwaysSpeculatableImplTrait
, HasParent<InitOp>
, ReturnLike
, Terminator
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
, RegionBranchTerminatorOpInterface
Effects: MemoryEffects::Effect{}
pyHIR.initModule
(::pylir::HIR::InitModuleOp)#
Syntax:
operation ::= `pyHIR.initModule` $module attr-dict
Op used to call an pyHIR.init
operation by executing its body.
$module
must be a reference to a pyHIR.init
operation with the given name.
As a special case, it is not possible to initialize the __main__
module.
Traits: AddableExceptionHandling<InitModuleExOp>
Interfaces: SymbolUserOpInterface
, pylir::HIR::InitModuleOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
module | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
pyHIR.initModuleEx
(::pylir::HIR::InitModuleExOp)#
Exception-handling variant of pyHIR.initModule
Syntax:
operation ::= `pyHIR.initModuleEx` $module attr-dict`\n` ` ` ` `
`label` $happy_path ( `(` $normal_dest_operands^ `:` type($normal_dest_operands) `)`)?
`unwind` $exception_path ( `(` $unwind_dest_operands^ `:` type($unwind_dest_operands) `)`)?
Traits: AttrSizedOperandSegments
, Terminator
Interfaces: BranchOpInterface
, ExceptionHandlingInterface
, SymbolUserOpInterface
, pylir::HIR::InitModuleOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
module | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
Operands:#
Operand |
Description |
---|---|
|
variadic of any type |
|
variadic of any type |
Successors:#
Successor |
Description |
---|---|
|
any successor |
|
any successor |
pyHIR.return
(::pylir::HIR::ReturnOp)#
Syntax:
operation ::= `pyHIR.return` $value attr-dict
Operation used to return from within a function.
Control is returned back to the caller and the result of the function call
is populated with $value
.
Traits: AlwaysSpeculatableImplTrait
, HasParent<FuncOp, GlobalFuncOp>
, ReturnLike
, Terminator
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
, RegionBranchTerminatorOpInterface
Effects: MemoryEffects::Effect{}
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
pyHIR.setAttr
(::pylir::HIR::SetAttrOp)#
Syntax:
operation ::= `pyHIR.setAttr` $attribute `of` $object `to` $value attr-dict
Traits: AddableExceptionHandling<SetAttrExOp>
Interfaces: InferTypeOpInterface
, pylir::HIR::SetAttrOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
attribute | ::mlir::StringAttr | string attribute |
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyHIR.setAttrEx
(::pylir::HIR::SetAttrExOp)#
Exception-handling variant of pyHIR.setAttr
Syntax:
operation ::= `pyHIR.setAttrEx` $attribute `of` $object `to` $value attr-dict
`\n` ` ` ` `
`label` $happy_path ( `(` $normal_dest_operands^ `:` type($normal_dest_operands) `)`)?
`unwind` $exception_path ( `(` $unwind_dest_operands^ `:` type($unwind_dest_operands) `)`)?
Traits: AttrSizedOperandSegments
, Terminator
Interfaces: BranchOpInterface
, ExceptionHandlingInterface
, InferTypeOpInterface
, pylir::HIR::SetAttrOpInterface
Attributes:#
Attribute | MLIR Type | Description |
---|---|---|
attribute | ::mlir::StringAttr | string attribute |
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
|
variadic of any type |
|
variadic of any type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
Successors:#
Successor |
Description |
---|---|
|
any successor |
|
any successor |
pyHIR.setItem
(::pylir::HIR::SetItemOp)#
Syntax:
operation ::= `pyHIR.setItem` $object `[` $index `]` `to` $value attr-dict
Traits: AddableExceptionHandling<SetItemExOp>
Interfaces: InferTypeOpInterface
, pylir::HIR::SetItemOpInterface
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
|
dynamic type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
pyHIR.setItemEx
(::pylir::HIR::SetItemExOp)#
Exception-handling variant of pyHIR.setItem
Syntax:
operation ::= `pyHIR.setItemEx` $object `[` $index `]` `to` $value attr-dict
`\n` ` ` ` `
`label` $happy_path ( `(` $normal_dest_operands^ `:` type($normal_dest_operands) `)`)?
`unwind` $exception_path ( `(` $unwind_dest_operands^ `:` type($unwind_dest_operands) `)`)?
Traits: AttrSizedOperandSegments
, Terminator
Interfaces: BranchOpInterface
, ExceptionHandlingInterface
, InferTypeOpInterface
, pylir::HIR::SetItemOpInterface
Operands:#
Operand |
Description |
---|---|
|
dynamic type |
|
dynamic type |
|
dynamic type |
|
variadic of any type |
|
variadic of any type |
Results:#
Result |
Description |
---|---|
|
dynamic type |
Successors:#
Successor |
Description |
---|---|
|
any successor |
|
any successor |