[llvm-dev] Optimization Record

Florian Hahn via llvm-dev llvm-dev at lists.llvm.org
Wed Nov 27 01:00:58 PST 2019


Hi,

> On Nov 27, 2019, at 07:16, Sooyeon Lee via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> I want to know all the optimization applied by the passes.
> 
> I found two options in clang
> 1. -fsave-optimization-record  2. -Rpass-analysis=...
> 
> However, they have nothing to do with the interaction btw IR files(.ll)
> Is there any tool that records all optimizations on IR file?


Are you looking for a way to save all optimization remarks/records when using ‘opt’? I think passing `-pass-remarks-output=foo.yaml` should do the trick and create a YAML file with the optimization remarks.

There also are additional flags to selectively print remarks:

*  -pass-remarks=‘pass-name’ …. Print optimization remarks for pass-name
*  -pass-remarks-missed=‘pass-name’ …. Print missed optimization remarks for pass-name
*  -pass-remarks-analysis=‘pass-name’ …. Print analysis optimization remarks for pass-name

pass-name can also be a regular expression for the above.

Cheers,
Florian


More information about the llvm-dev mailing list