mlir.dialects._index_ops_gen

Attributes

Classes

_Dialect

AddOp

The index.add operation takes two index values and computes their sum.

AndOp

The index.and operation takes two index values and computes their bitwise

BoolConstantOp

The index.bool.constant operation produces an bool-typed SSA value equal

CastSOp

The index.casts operation enables conversions between values of index type

CastUOp

The index.castu operation enables conversions between values of index type

CeilDivSOp

The index.ceildivs operation takes two index values and computes their

CeilDivUOp

The index.ceildivu operation takes two index values and computes their

CmpOp

The index.cmp operation takes two index values and compares them according

ConstantOp

The index.constant operation produces an index-typed SSA value equal to

DivSOp

The index.divs operation takes two index values and computes their signed

DivUOp

The index.divu operation takes two index values and computes their

FloorDivSOp

The index.floordivs operation takes two index values and computes their

MaxSOp

The index.maxs operation takes two index values and computes their signed

MaxUOp

The index.maxu operation takes two index values and computes their

MinSOp

The index.mins operation takes two index values and computes their signed

MinUOp

The index.minu operation takes two index values and computes their

MulOp

The index.mul operation takes two index values and computes their product.

OrOp

The index.or operation takes two index values and computes their bitwise

RemSOp

The index.rems operation takes two index values and computes their signed

RemUOp

The index.remu operation takes two index values and computes their

ShlOp

The index.shl operation shifts an index value to the left by a variable

ShrSOp

The index.shrs operation shifts an index value to the right by a variable

ShrUOp

The index.shru operation shifts an index value to the right by a variable

SizeOfOp

The index.sizeof operation produces an index-typed SSA value equal to the

SubOp

The index.sub operation takes two index values and computes the difference

XOrOp

The index.xor operation takes two index values and computes their bitwise

Functions

add(→ _ods_ir)

and_(→ _ods_ir)

bool_constant(→ _ods_ir)

casts(→ _ods_ir)

castu(→ _ods_ir)

ceildivs(→ _ods_ir)

ceildivu(→ _ods_ir)

cmp(→ _ods_ir)

constant(→ _ods_ir)

divs(→ _ods_ir)

divu(→ _ods_ir)

floordivs(→ _ods_ir)

maxs(→ _ods_ir)

maxu(→ _ods_ir)

mins(→ _ods_ir)

minu(→ _ods_ir)

mul(→ _ods_ir)

or_(→ _ods_ir)

rems(→ _ods_ir)

remu(→ _ods_ir)

shl(→ _ods_ir)

shrs(→ _ods_ir)

shru(→ _ods_ir)

sizeof(→ _ods_ir)

sub(→ _ods_ir)

xor(→ _ods_ir)

Module Contents

mlir.dialects._index_ops_gen._ods_ir
class mlir.dialects._index_ops_gen._Dialect(descriptor: object)

Bases: _ods_ir

DIALECT_NAMESPACE = 'index'
class mlir.dialects._index_ops_gen.AddOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.add operation takes two index values and computes their sum.

Example:

// c = a + b
%c = index.add %a, %b
OPERATION_NAME = 'index.add'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.add(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.AndOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.and operation takes two index values and computes their bitwise and.

Example:

// c = a & b
%c = index.and %a, %b
OPERATION_NAME = 'index.and'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.and_(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.BoolConstantOp(value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.bool.constant operation produces an bool-typed SSA value equal to either true or false.

This operation is used to materialize bool constants that arise when folding index.cmp.

Example:

%0 = index.bool.constant true
OPERATION_NAME = 'index.bool.constant'
_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).

mlir.dialects._index_ops_gen.bool_constant(value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.CastSOp(output, input, *, loc=None, ip=None)

Bases: _ods_ir

The index.casts operation enables conversions between values of index type and concrete fixed-width integer types. If casting to a wider integer, the value is sign-extended. If casting to a narrower integer, the value is truncated.

Example:

// Cast to i32
%0 = index.casts %a : index to i32

// Cast from i64
%1 = index.casts %b : i64 to index
OPERATION_NAME = 'index.casts'
_ODS_REGIONS = (0, True)
input() _ods_ir
output() _ods_ir
mlir.dialects._index_ops_gen.casts(output, input, *, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.CastUOp(output, input, *, loc=None, ip=None)

Bases: _ods_ir

The index.castu operation enables conversions between values of index type and concrete fixed-width integer types. If casting to a wider integer, the value is zero-extended. If casting to a narrower integer, the value is truncated.

Example:

// Cast to i32
%0 = index.castu %a : index to i32

// Cast from i64
%1 = index.castu %b : i64 to index
OPERATION_NAME = 'index.castu'
_ODS_REGIONS = (0, True)
input() _ods_ir
output() _ods_ir
mlir.dialects._index_ops_gen.castu(output, input, *, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.CeilDivSOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.ceildivs operation takes two index values and computes their signed quotient. Treats the leading bit as the sign and rounds towards positive infinity, i.e. 7 / -2 = -3.

Note: division by zero and signed division overflow are undefined behaviour.

Example:

// c = ceil(a / b)
%c = index.ceildivs %a, %b
OPERATION_NAME = 'index.ceildivs'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.ceildivs(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.CeilDivUOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.ceildivu operation takes two index values and computes their unsigned quotient. Treats the leading bit as the most significant and rounds towards positive infinity, i.e. 6 / -2 = 1.

Note: division by zero is undefined behaviour.

Example:

// c = ceil(a / b)
%c = index.ceildivu %a, %b
OPERATION_NAME = 'index.ceildivu'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.ceildivu(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.CmpOp(pred, lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.cmp operation takes two index values and compares them according to the comparison predicate and returns an i1. The following comparisons are supported:

  • eq: equal

  • ne: not equal

  • slt: signed less than

  • sle: signed less than or equal

  • sgt: signed greater than

  • sge: signed greater than or equal

  • ult: unsigned less than

  • ule: unsigned less than or equal

  • ugt: unsigned greater than

  • uge: unsigned greater than or equal

The result is 1 if the comparison is true and 0 otherwise.

Example:

// Signed less than comparison.
%0 = index.cmp slt(%a, %b)

// Unsigned greater than or equal comparison.
%1 = index.cmp uge(%a, %b)

// Not equal comparison.
%2 = index.cmp ne(%a, %b)
OPERATION_NAME = 'index.cmp'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
pred() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.cmp(pred, lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.ConstantOp(value, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.constant operation produces an index-typed SSA value equal to some index-typed integer constant.

Example:

%0 = index.constant 42
OPERATION_NAME = 'index.constant'
_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).

mlir.dialects._index_ops_gen.constant(value, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.DivSOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.divs operation takes two index values and computes their signed quotient. Treats the leading bit as the sign and rounds towards zero, i.e. 6 / -2 = -3.

Note: division by zero and signed division overflow are undefined behaviour.

Example:

// c = a / b
%c = index.divs %a, %b
OPERATION_NAME = 'index.divs'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.divs(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.DivUOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.divu operation takes two index values and computes their unsigned quotient. Treats the leading bit as the most significant and rounds towards zero, i.e. 6 / -2 = 0.

Note: division by zero is undefined behaviour.

Example:

// c = a / b
%c = index.divu %a, %b
OPERATION_NAME = 'index.divu'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.divu(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.FloorDivSOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.floordivs operation takes two index values and computes their signed quotient. Treats the leading bit as the sign and rounds towards negative infinity, i.e. 5 / -2 = -3.

Note: division by zero and signed division overflow are undefined behaviour.

Example:

// c = floor(a / b)
%c = index.floordivs %a, %b
OPERATION_NAME = 'index.floordivs'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.floordivs(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.MaxSOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.maxs operation takes two index values and computes their signed maximum value. Treats the leading bit as the sign, i.e. max(-2, 6) = 6.

Example:

// c = max(a, b)
%c = index.maxs %a, %b
OPERATION_NAME = 'index.maxs'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.maxs(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.MaxUOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.maxu operation takes two index values and computes their unsigned maximum value. Treats the leading bit as the most significant, i.e. max(15, 6) = 15 or max(-2, 6) = -2.

Example:

// c = max(a, b)
%c = index.maxu %a, %b
OPERATION_NAME = 'index.maxu'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.maxu(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.MinSOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.mins operation takes two index values and computes their signed minimum value. Treats the leading bit as the sign, i.e. min(-2, 6) = -2.

Example:

// c = min(a, b)
%c = index.mins %a, %b
OPERATION_NAME = 'index.mins'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.mins(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.MinUOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.minu operation takes two index values and computes their unsigned minimum value. Treats the leading bit as the most significant, i.e. min(15, 6) = 6 or min(-2, 6) = 6.

Example:

// c = min(a, b)
%c = index.minu %a, %b
OPERATION_NAME = 'index.minu'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.minu(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.MulOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.mul operation takes two index values and computes their product.

Example:

// c = a * b
%c = index.mul %a, %b
OPERATION_NAME = 'index.mul'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.mul(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.OrOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.or operation takes two index values and computes their bitwise or.

Example:

// c = a | b
%c = index.or %a, %b
OPERATION_NAME = 'index.or'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.or_(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.RemSOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.rems operation takes two index values and computes their signed remainder. Treats the leading bit as the sign, i.e. 6 % -2 = 0.

Example:

// c = a % b
%c = index.rems %a, %b
OPERATION_NAME = 'index.rems'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.rems(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.RemUOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.remu operation takes two index values and computes their unsigned remainder. Treats the leading bit as the most significant, i.e. 6 % -2 = 6.

Example:

// c = a % b
%c = index.remu %a, %b
OPERATION_NAME = 'index.remu'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.remu(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.ShlOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.shl operation shifts an index value to the left by a variable amount. The low order bits are filled with zeroes. The RHS operand is always treated as unsigned. If the RHS operand is equal to or greater than the index bitwidth, the result is a poison value.

Example:

// c = a << b
%c = index.shl %a, %b
OPERATION_NAME = 'index.shl'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.shl(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.ShrSOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.shrs operation shifts an index value to the right by a variable amount. The LHS operand is treated as signed. The high order bits are filled with copies of the most significant bit. If the RHS operand is equal to or greater than the index bitwidth, the result is a poison value.

Example:

// c = a >> b
%c = index.shrs %a, %b
OPERATION_NAME = 'index.shrs'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.shrs(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.ShrUOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.shru operation shifts an index value to the right by a variable amount. The LHS operand is treated as unsigned. The high order bits are filled with zeroes. If the RHS operand is equal to or greater than the index bitwidth, the result is a poison value.

Example:

// c = a >> b
%c = index.shru %a, %b
OPERATION_NAME = 'index.shru'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.shru(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.SizeOfOp(*, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.sizeof operation produces an index-typed SSA value equal to the size in bits of the index type. For example, on 32-bit systems, the result is 32 : index, and on 64-bit systems, the result is 64 : index.

Example:

%0 = index.sizeof
OPERATION_NAME = 'index.sizeof'
_ODS_REGIONS = (0, True)
result() _ods_ir

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

mlir.dialects._index_ops_gen.sizeof(*, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.SubOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.sub operation takes two index values and computes the difference of the first from the second operand.

Example:

// c = a - b
%c = index.sub %a, %b
OPERATION_NAME = 'index.sub'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.sub(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir
class mlir.dialects._index_ops_gen.XOrOp(lhs, rhs, *, results=None, loc=None, ip=None)

Bases: _ods_ir

The index.xor operation takes two index values and computes their bitwise xor.

Example:

// c = a ^ b
%c = index.xor %a, %b
OPERATION_NAME = 'index.xor'
_ODS_REGIONS = (0, True)
lhs() _ods_ir
rhs() _ods_ir
result() _ods_ir

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

mlir.dialects._index_ops_gen.xor(lhs, rhs, *, results=None, loc=None, ip=None) _ods_ir