mlir.dialects.ub

Classes

PoisonOp

The poison operation materializes a compile-time poisoned constant value

PoisonOpAdaptor

UnreachableOp

The unreachable operation triggers immediate undefined behavior if

UnreachableOpAdaptor

Functions

poison(→ _ods_ir)

unreachable(→ UnreachableOp)

Module Contents

class mlir.dialects.ub.PoisonOp(result, *, value=None, loc=None, ip=None)

Bases: _ods_ir

The poison operation materializes a compile-time poisoned constant value to indicate deferred undefined behavior. value attribute is needed to indicate an optional additional poison semantics (e.g. partially poisoned vectors), default value indicates results is fully poisoned.

Examples:

// Short form
%0 = ub.poison : i32
// Long form
%1 = ub.poison <#custom_poison_elements_attr> : vector<4xi64>
OPERATION_NAME = 'ub.poison'
_ODS_REGIONS = (0, True)
value() _ods_ir
result() _ods_ir

Shortcut to get an op result if it has only one (throws an error otherwise).

class mlir.dialects.ub.PoisonOpAdaptor(operands: list, attributes: OpAttributeMap)
class mlir.dialects.ub.PoisonOpAdaptor(operands: list, opview: OpView)

Bases: _ods_ir

OPERATION_NAME = 'ub.poison'
value() _ods_ir
mlir.dialects.ub.poison(result, *, value=None, loc=None, ip=None) _ods_ir
class mlir.dialects.ub.UnreachableOp(*, loc=None, ip=None)

Bases: _ods_ir

The unreachable operation triggers immediate undefined behavior if executed.

Example:

ub.unreachable
OPERATION_NAME = 'ub.unreachable'
_ODS_REGIONS = (0, True)
class mlir.dialects.ub.UnreachableOpAdaptor(operands: list, attributes: OpAttributeMap)
class mlir.dialects.ub.UnreachableOpAdaptor(operands: list, opview: OpView)

Bases: _ods_ir

OPERATION_NAME = 'ub.unreachable'
mlir.dialects.ub.unreachable(*, loc=None, ip=None) UnreachableOp