qat.backend.passes.purr.transform module
- class DesugaringPass
Bases:
TransformPassTransforms syntactic sugars and implicit effects.
The goal of this pass is to desugar any syntactic and semantic sugars. One of these sugars is iteration constructs such as
SweepandRepeat.- 1- Adds an iterator variable for sweep loops. We state that sweep loops implicitly
declare an iterator variable to control progress of the sweep. See
BindingPass
- run(ir, res_mgr, *args, **kwargs)
- Parameters:
ir¶ (
InstructionBuilder) – The list of instructions stored in anInstructionBuilder.
- class ScopePeeling
Bases:
TransformPassA transform pass to discard scopes assuming they’ve been identified.
This pass is particularly useful for the code generator as it helps peel away any unwanted scopes. In fact, some sweeps are not lowerable and the user may choose to annotate certain sweeps and opt for static injection of variables with a switerator-like emitter. These sweep loops will be handled by the emitter statically while allowing it to lower nested constructs efficiently.
- run(ir, res_mgr, met_mgr, *args, **kwargs)