Skip to content

Improving ASR passes infrastructure #943

Open
@certik

Description

@certik

Currently one can print all passes using lfortran --pass xx examples/expr2.f90.

High priority:

Low priority:

  • figure out how to handle parameters for each pass. Some kind of a map of argument name, type and value; dynamically constructed from the ASR passes cpp files; keep the door open for creating plugins for ASR passes, that are registered at runtime (using a shared library)
  • Expose arguments in the driver
  • Add lfortran --print-passes which would print all passes, one on each line, with a "name" and a "one line description"
  • Add lfortran --print-pass=fma which will print "name", "one line description", "full multi-paragraph description", "all parameters: names, types, default values"
  • Add lfortran --print-pass-pipeline --show-llvm examples/expr2.f90 that will print half a page of all the passes in some format such as arr_slice,do_loops,fma[ax=5,b=7],... including all parameters that the LLVM backend (let's say) sets for the given pass (and the given compiler options such as --fast and architecture, for loop unrolling for example).
  • Add lfortran --pass="arr_slice,fma[ax=5,b=7]" --show-llvm examples/expr2.f90 that would reproduce the default LLVM pass pipeline; then one can modify it and the command line (add/remove passes, change pass parameters)
  • Idea: instead of (or in addition to) --pass="arr_slice,fma[ax=5,b=7]" LFortran could generate (via --print-pass-pipeline) and then the user provide a JSON file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions