qat.experimental.dialect.q1.transforms.verify_allocation module

Verification helpers and pass for Q1 register allocation.

This module checks that every Q1 register value in a sequence has been fully allocated to a physical register before later lowering passes consume it.

class VerifyQ1AllocationPass

Bases: OrderedPass, ModulePass

Reject any Q1 register value that is still unallocated or virtual.

The pass walks every SequenceOp in the module, including nested regions, and aggregates all allocation issues into a single PassFailedException.

apply(ctx, op)

Verify all sequences in the module have properly allocated registers.

Parameters:
  • ctx (Context) – The pass context required by the xDSL module-pass interface.

  • op (ModuleOp) – The module whose sequences should be validated.

Raises:

PassFailedException – If any Q1 register remains unallocated or virtual.

Return type:

None

name: ClassVar[str] = 'q1-verify-allocation'
verify_sequence_allocation(sequence)

Verify that all registers in a sequence are properly allocated.

Parameters:

sequence (SequenceOp) – The sequence to verify.

Return type:

list[str]

Returns:

A list of distinct error messages for any allocation issues found.