soumitrachatterjee / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Note: the repository does not accept github pull requests at this moment. Please submit your patches at http://reviews.llvm.org.
http://llvm.org
Other
0 stars 7 forks source link

Enumerate all passes being invoked #18

Open soumitrachatterjee opened 1 year ago

soumitrachatterjee commented 1 year ago

Study the output of the options -mllvm -print-after-all and/or -mllvm -print-before-all, which prints the IR after/before each pass.

Additionally, study the output of the option -debug-pass=Structure. Note that the output does not change based on the optimization level specified as this option does not provide the desired level of detail to see the optimizations performed at each optimization level.

When the option -debug-pass=List is specified on the command line, implement a functionality similar to the -print-after-all, except that instead of the IR, the name of all the passes being invoked should be listed (similar to -debug-pass=Structure), such that we can see the list of passes being invoked at different optimization levels.

With the new option -debug-pass=List, we should be able to list the various passes being invoked corresponding to the optimization level specified.

For example, the two compilation commands clang -O2 -mllvm -debug-pass=List filename.cpp and clang -O3 -mllvm -debug-pass=List filename.cpp can be used to identify the difference in the passes invoked between optimization levels 2 and 3.