qat.experimental.dialect.pulse.transforms.dead_frame_elimination module

Remove dead operations that act on otherwise inactive frames.

This pass uses frame-lineage analysis to identify logical frames that are never used by hardware-visible pulse operations. For each dead lineage, it removes only the lineage members that directly transform or advance the frame value.

The pass intentionally stays narrow: if a frame flows through non-pulse control flow, the lineage is conservatively preserved instead of rewriting that structure.

class DeadFrameEliminationPass

Bases: ModulePass

Erase frame lineages that never participate in a live pulse-level operation.

Operation Classification:

  • Live operations (hardware-visible): AcquireOp, PulseOp, StartContinuousWaveformOp, StopContinuousWaveformOp, SynchronizeOp. A frame is preserved if its lineage contains any live operation.

  • Non-live operations (frame metadata/timing): CreateFrameOp, PhaseSetOp, PhaseShiftOp, WaitOp. These do not prevent frame elimination.

  • Unknown operations (outside pulse dialect): Operations unknown to this pass are conservatively treated as live (fail-safe behavior) to avoid incorrectly eliminating frames passed to external control flow or dialect operations.

Note

SynchronizeOp is classified as live because timing delays on a frame can affect synchronized frames even if the frame itself carries no pulse data. It is recommended to run this pass after synchronization elimination to avoid these interdependencies.

Note

Frames that thread through operations that do not belong to the pulse dialect are treated conservatively, and those frames are not removed. This includes frames created within a region-bearing operation and yielded outside the region, as the terminating operations will conservatively mark a frame alive.

apply(ctx, op)

Eliminate frame lineages that contain no live pulse operations.

For each frame creation, walks its lineage to determine if it contains any hardware- visible pulse operations. If the lineage contains only non-live operations (phase sets, shifts, waits), the entire frame and its operations are erased. Unknown operations trigger a warning and are treated as keeping the frame alive.

Parameters:
  • ctx (Context) – xDSL context.

  • op (ModuleOp) – Module to optimize.

Return type:

None

name: ClassVar[str] = 'pulse.dead-frame-elimination'