How to disable each passes of different optimization level with LLVM

I want to get what are passes available in each optimization level and want to disable each pass in the different optimization level .

Want to do similarly in llvm :
Similar command in GCC - GCC -c -Q -O3 --help=optimizers
Then we can disable each optimization flags with -fno-(flagsname) .

I want to get what are passes available in each optimization level and want to disable each pass in the different optimization level .

[PM] Equivalent of -debug-pass=Arguments/-debug-pass=Structure · Issue #28692 · llvm/llvm-project · GitHub tracks this feature request for new pass manager. And this is a related answer, pointing out opt has option -print-pipeline-passes (but my understanding is that there is no guarantee that opt pipeline is the same as clang pipeline even at the same optimization level)

I think -mllvm -print-after-all (Compiler Explorer) over a simple function should tell most of the passes. But as analysis passes are lazily evaluated, cached and recomputed upon invalidation during a real compilation, I think simple functions print doesn’t reflect the case for a real-world function being studied.

want to disable each pass in the different optimization level .

I don’t know if there are options to do this in the middle end. For many backend passes, there are existing options (llvm-project/TargetPassConfig.cpp at main · llvm/llvm-project · GitHub) to turn passes on and off.