I’m please to announce the first release of llopt
, a tool that takes a LLVM-IR file and gives you back the optimized LLVM-IR using the LLVM optimization passes.
The tool can be useful for quickly testing what optimizations are done by LLVM:
- depending on the optimization level (the Clang equivalent of
-O0
,-O1
,-O2
or-O3
) - what does the LTO optimization pass
The tool also gives you a quick way see if your LLVM-IR module is syntactically correct or not by just disabling the optimizations (--opt=-1
).
Of course the tool is written in OCaml using the official LLVM binding and is available via OPAM.
Its source code is really small and straightforward and can be easily modified to check specific optimizations:
Happy testing !