opt optimization

Is there any way to find if a optimization pass has passed in opt?
In clang -fsave-optimzization-record would tell if particular optimization pass has applied or failed.
Is there similar functionality in opt?

Regards,
Nethish.

Hi Nethish,

I recently learned about -print-after-all. This will print the IR after each pass. This is not exactly what you want but in the meantime it may help.

Best,
Stefanos

Στις Πέμ, 9 Απρ 2020 στις 4:22 π.μ., ο/η nethish via llvm-dev <llvm-dev@lists.llvm.org> έγραψε:

The following might be also helpful:

-debug-pass=Structure
-debug-pass=Executions

-Andrzej

Hi,

For opt and llc you can use:

–pass-remarks-filter= - Only record optimization remarks from passes whose names match the given regular expression
–pass-remarks-format= - The format used for serializing remarks (default: YAML)
–pass-remarks-output= - Output filename for pass remarks

Cheers,

— Francis