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
Currently one can print all passes using
lfortran --pass xx examples/expr2.f90.High priority:
pass_manager.h#966, Simplifying registering passes inpass_manager.hlfortran/lfortran#158Low priority:
lfortran --print-passeswhich would print all passes, one on each line, with a "name" and a "one line description"lfortran --print-pass=fmawhich will print "name", "one line description", "full multi-paragraph description", "all parameters: names, types, default values"lfortran --print-pass-pipeline --show-llvm examples/expr2.f90that will print half a page of all the passes in some format such asarr_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--fastand architecture, for loop unrolling for example).lfortran --pass="arr_slice,fma[ax=5,b=7]" --show-llvm examples/expr2.f90that would reproduce the default LLVM pass pipeline; then one can modify it and the command line (add/remove passes, change pass parameters)--pass="arr_slice,fma[ax=5,b=7]"LFortran could generate (via--print-pass-pipeline) and then the user provide a JSON file