Finding which optimization passes have failed

Dear LLVM community,
How to find out which optimization passes have been performed and which passes have failed?

Regards,
Pradeep Kumar

Dear LLVM community,
   How to find out which optimization passes have been performed and which passes have failed?

First please define “failed”.
If you mean “crash”, there will be a stack dump anyway.
If you mean failed to optimize the code(into better code for example), the opt option “-print-after-all” might help you, it would print the result IR after each optimization passes.

Regarding which optimization do clang run, clang option “-mllvm -debug-pass=Arguments” might be the thing you’re looking for

Bests,
Bekket

Hello,

You might be looking for optimization remarks.

You should take a look at the -fsave-optimization-record and -Rpass* flags.

Cheers,