Skip to content

Feature: Forward dataflow analysis for analog and atomic interfaces #105

Description

@vishnu-m77

Forward dataflow analysis includes reaching definitions and available expressions. The analysis should be implemented in the directory src/oqd-core/analysis/.

Using lattice.py and dataflow.py in oqd-compiler-infrastructure, forward dataflow analysis can be implemented for both analog and atomic interfaces. After the program is passed through the frontend, and the typed AST is obtained, a control flow graph (CFG) is built from it. The type checker verifies the types in the CFG.

Dataflow analysis needs a symbol table. The CFG can be modified to build and hold a symbol table, or the symbol table can be built from the typed AST separately. This is a design choice which depends on how the different analyses will use the CFG and the symbol table.

The result of the analysis should be used to build analysis passes (or something similar) to update the CFG or the typed AST. Ideally, since analysis passes can be run sequentially, they should update the CFG. After running all the passes, the updated CFG should be used to modify the typed AST. This is necessary as the current requirement of the compiler passes is a typed AST.

If SSA is implemented in the future, it will simplify dataflow analysis. However, it would require a refactor of the compiler passes, and lowering the code into ARTIQ.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions