[MLIR] Add --list-passes option to mlir-opt

Currently, the only way to see the registered passes (and pipelines) is by calling “mlir-opt --help”. However, for compilers with 500+ passes, the help message becomes too long and sometimes hard to understand. For this purpose, I consider that adding a dedicated --list-passes (and maybe a --list-pipelines) option to mlir-opt would be extremely useful. I am curious about your opinions on this, and if you think that such a modification could be merged in the project.

Regarding the implementation, it shouldn’t be complicated, as the code from PassRegistry.cpp#L854-L871 can be reused and exposed using a function defined in PassRegistry header file. Also, besides this, the --list-passes option should also be declared.

I created a PR with the implementation.