Test
test
¶
Test = Dialect('test', [TestOp, TestPureOp, TestReadOp, TestTermOp, TestWriteOp, TestSymbolOp, TestAllocatableOp, TestRegionBranchOp, TestRegionBranchTerminatorOp], [TestType, TestRegisterType], [OpAsmDialectInterface()])
module-attribute
¶
TestOp
¶
Bases: IRDLOperation
This operation can produce an arbitrary number of SSAValues with arbitrary types. It is used in filecheck testing to reduce to artificial dependencies on other dialects (i.e. dependencies that only come from the structure of the test rather than the actual dialect).
Source code in xdsl/dialects/test.py
name = 'test.op'
class-attribute
instance-attribute
¶
res = var_result_def()
class-attribute
instance-attribute
¶
ops = var_operand_def()
class-attribute
instance-attribute
¶
regs = var_region_def()
class-attribute
instance-attribute
¶
prop1 = opt_prop_def()
class-attribute
instance-attribute
¶
prop2 = opt_prop_def()
class-attribute
instance-attribute
¶
prop3 = opt_prop_def()
class-attribute
instance-attribute
¶
__init__(operands: Sequence[SSAValue | Operation] = (), result_types: Sequence[Attribute] = (), attributes: Mapping[str, Attribute | None] | None = None, properties: Mapping[str, Attribute | None] | None = None, regions: Sequence[Region | Sequence[Operation] | Sequence[Block]] = ())
¶
Source code in xdsl/dialects/test.py
TestTermOp
¶
Bases: IRDLOperation
This operation can produce an arbitrary number of SSAValues with arbitrary types. It is used in filecheck testing to reduce to artificial dependencies on other dialects (i.e. dependencies that only come from the structure of the test rather than the actual dialect). Its main difference from TestOp is that it satisfies the IsTerminator trait and can be used as a block terminator operation.
Source code in xdsl/dialects/test.py
name = 'test.termop'
class-attribute
instance-attribute
¶
res = var_result_def()
class-attribute
instance-attribute
¶
ops = var_operand_def()
class-attribute
instance-attribute
¶
regs = var_region_def()
class-attribute
instance-attribute
¶
successor = var_successor_def()
class-attribute
instance-attribute
¶
prop1 = opt_prop_def()
class-attribute
instance-attribute
¶
prop2 = opt_prop_def()
class-attribute
instance-attribute
¶
prop3 = opt_prop_def()
class-attribute
instance-attribute
¶
traits = traits_def(IsTerminator())
class-attribute
instance-attribute
¶
__init__(operands: Sequence[SSAValue | Operation] = (), result_types: Sequence[Attribute] = (), attributes: Mapping[str, Attribute | None] | None = None, properties: Mapping[str, Attribute | None] | None = None, successors: Sequence[Block] = (), regions: Sequence[Region | Sequence[Operation] | Sequence[Block]] = ())
¶
Source code in xdsl/dialects/test.py
TestPureOp
¶
Bases: IRDLOperation
This operation can produce an arbitrary number of SSAValues with arbitrary types. It is used in filecheck testing to reduce to artificial dependencies on other dialects (i.e. dependencies that only come from the structure of the test rather than the actual dialect). Its main difference from TestOp is that it satisfies the Pure trait, so we can test region CSE - this op assumes no side effects nowhere in its regions.
Source code in xdsl/dialects/test.py
name = 'test.pureop'
class-attribute
instance-attribute
¶
res = var_result_def()
class-attribute
instance-attribute
¶
ops = var_operand_def()
class-attribute
instance-attribute
¶
regs = var_region_def()
class-attribute
instance-attribute
¶
successor = var_successor_def()
class-attribute
instance-attribute
¶
prop1 = opt_prop_def()
class-attribute
instance-attribute
¶
prop2 = opt_prop_def()
class-attribute
instance-attribute
¶
prop3 = opt_prop_def()
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
__init__(operands: Sequence[SSAValue | Operation] = (), result_types: Sequence[Attribute] = (), attributes: Mapping[str, Attribute | None] | None = None, properties: Mapping[str, Attribute | None] | None = None, successors: Sequence[Block] = (), regions: Sequence[Region | Sequence[Operation] | Sequence[Block]] = ())
¶
Source code in xdsl/dialects/test.py
TestReadOp
¶
Bases: IRDLOperation
This operation can produce an arbitrary number of SSAValues with arbitrary types. It is used in filecheck testing to reduce to artificial dependencies on other dialects (i.e. dependencies that only come from the structure of the test rather than the actual dialect). Its main difference from TestOp is that it satisfies the MemoryReadEffect trait, so we can test CSE - this op assumes it always and only reads.
Source code in xdsl/dialects/test.py
name = 'test.op_with_memread'
class-attribute
instance-attribute
¶
res = var_result_def()
class-attribute
instance-attribute
¶
ops = var_operand_def()
class-attribute
instance-attribute
¶
regs = var_region_def()
class-attribute
instance-attribute
¶
successor = var_successor_def()
class-attribute
instance-attribute
¶
prop1 = opt_prop_def()
class-attribute
instance-attribute
¶
prop2 = opt_prop_def()
class-attribute
instance-attribute
¶
prop3 = opt_prop_def()
class-attribute
instance-attribute
¶
traits = traits_def(MemoryReadEffect())
class-attribute
instance-attribute
¶
__init__(operands: Sequence[SSAValue | Operation] = (), result_types: Sequence[Attribute] = (), attributes: Mapping[str, Attribute | None] | None = None, properties: Mapping[str, Attribute | None] | None = None, successors: Sequence[Block] = (), regions: Sequence[Region | Sequence[Operation] | Sequence[Block]] = ())
¶
Source code in xdsl/dialects/test.py
TestWriteOp
¶
Bases: IRDLOperation
This operation can produce an arbitrary number of SSAValues with arbitrary types. It is used in filecheck testing to reduce to artificial dependencies on other dialects (i.e. dependencies that only come from the structure of the test rather than the actual dialect). Its main difference from TestOp is that it satisfies the MemoryReadEffect trait, so we can test CSE - this op assumes it always and only writes.
Source code in xdsl/dialects/test.py
name = 'test.op_with_memwrite'
class-attribute
instance-attribute
¶
res = var_result_def()
class-attribute
instance-attribute
¶
ops = var_operand_def()
class-attribute
instance-attribute
¶
regs = var_region_def()
class-attribute
instance-attribute
¶
successor = var_successor_def()
class-attribute
instance-attribute
¶
prop1 = opt_prop_def()
class-attribute
instance-attribute
¶
prop2 = opt_prop_def()
class-attribute
instance-attribute
¶
prop3 = opt_prop_def()
class-attribute
instance-attribute
¶
traits = traits_def(MemoryWriteEffect())
class-attribute
instance-attribute
¶
__init__(operands: Sequence[SSAValue | Operation] = (), result_types: Sequence[Attribute] = (), attributes: Mapping[str, Attribute | None] | None = None, properties: Mapping[str, Attribute | None] | None = None, successors: Sequence[Block] = (), regions: Sequence[Region | Sequence[Operation] | Sequence[Block]] = ())
¶
Source code in xdsl/dialects/test.py
TestConstantOp
¶
Bases: IRDLOperation, HasFolderInterface
Minimal integer constant op for tests that need a ConstantLike producer.
Source code in xdsl/dialects/test.py
name = 'test.constant'
class-attribute
instance-attribute
¶
result = result_def(IntegerType)
class-attribute
instance-attribute
¶
value = prop_def(IntegerAttr)
class-attribute
instance-attribute
¶
traits = traits_def(Pure(), ConstantLike())
class-attribute
instance-attribute
¶
__init__(value: int | IntegerAttr, value_type: IntegerType)
¶
TestType
dataclass
¶
Bases: Data[str], TypeAttribute
This attribute is used for testing in places where any attribute can be used. This allows reducing the artificial dependencies on attributes from other dialects.
Source code in xdsl/dialects/test.py
TestSymbolOp
¶
Bases: IRDLOperation
This operation can produce an arbitrary number of SSAValues with arbitrary types. It is used in filecheck testing to reduce to artificial dependencies on other dialects (i.e. dependencies that only come from the structure of the test rather than the actual dialect). Its main difference with TestOp is that it satisfies the SymbolOpInterface trait, meaning that we can attach a symbol name to it.
Source code in xdsl/dialects/test.py
name = 'test.op_with_symbol'
class-attribute
instance-attribute
¶
res = var_result_def()
class-attribute
instance-attribute
¶
ops = var_operand_def()
class-attribute
instance-attribute
¶
regs = var_region_def()
class-attribute
instance-attribute
¶
sym_name = prop_def(SymbolNameConstraint())
class-attribute
instance-attribute
¶
traits = traits_def(SymbolOpInterface())
class-attribute
instance-attribute
¶
__init__(operands: Sequence[SSAValue | Operation] = (), result_types: Sequence[Attribute] = (), attributes: Mapping[str, Attribute | None] | None = None, properties: Mapping[str, Attribute | None] | None = None, regions: Sequence[Region | Sequence[Operation] | Sequence[Block]] = ())
¶
Source code in xdsl/dialects/test.py
TestAllocatableOp
¶
Bases: IRDLOperation, HasRegisterConstraints
Source code in xdsl/dialects/test.py
name = 'test.allocatable'
class-attribute
instance-attribute
¶
in_operands = var_operand_def()
class-attribute
instance-attribute
¶
inout_operands = var_operand_def()
class-attribute
instance-attribute
¶
out_results = var_result_def()
class-attribute
instance-attribute
¶
inout_results = var_result_def()
class-attribute
instance-attribute
¶
traits = traits_def(RegisterAllocatedMemoryEffect())
class-attribute
instance-attribute
¶
irdl_options = (AttrSizedOperandSegments(), AttrSizedResultSegments())
class-attribute
instance-attribute
¶
__init__(in_operands: Sequence[SSAValue], inout_operands: Sequence[SSAValue], out_result_types: Sequence[Attribute], inout_result_types: Sequence[Attribute])
¶
Source code in xdsl/dialects/test.py
TestRegionBranchOp
dataclass
¶
Bases: IRDLOperation, RegionBranchOpInterface
This operation can take an arbitrary number of operands, results and regions. It implements RegionBranchOpInterface, and is used in filecheck testing of the RegionBranchOpTrait verifier.
Source code in xdsl/dialects/test.py
name = 'test.region_branch_op'
class-attribute
instance-attribute
¶
res = var_result_def()
class-attribute
instance-attribute
¶
ops = var_operand_def()
class-attribute
instance-attribute
¶
regs = var_region_def()
class-attribute
instance-attribute
¶
successor_regions(point: RegionBranchPoint) -> Sequence[RegionSuccessor]
¶
Enters the first region, if any. Every region branches back to the parent operation.
Source code in xdsl/dialects/test.py
TestRegionBranchTerminatorOp
dataclass
¶
Bases: IRDLOperation, RegionBranchTerminatorOpInterface
This terminator can take an arbitrary number of operands, results and successors. It implements RegionBranchTerminatorOpInterface, and is used in filecheck testing of the RegionBranchTerminatorOpTrait verifier, which rejects results and successors.
Source code in xdsl/dialects/test.py
name = 'test.region_branch_terminator'
class-attribute
instance-attribute
¶
res = var_result_def()
class-attribute
instance-attribute
¶
ops = var_operand_def()
class-attribute
instance-attribute
¶
successor = var_successor_def()
class-attribute
instance-attribute
¶
traits = traits_def(IsTerminator())
class-attribute
instance-attribute
¶
TestRegisterType
dataclass
¶
Bases: RegisterType