tldr/pages/common/opt.md
Vitor Henrique c8f956319f
pages*: simplify page description (#12149)
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2024-02-14 21:25:13 +01:00

505 B

opt

Runs optimizations and analyse LLVM source files. More information: https://llvm.org/docs/CommandGuide/opt.html.

  • Run an optimization or analysis on a bitcode file:

opt -{{passname}} {{path/to/file.bc}} -S -o {{file_opt.bc}}

  • Output the Control Flow Graph of a function to a .dot file:

opt {{-dot-cfg}} -S {{path/to/file.bc}} -disable-output

  • Optimize the program at level 2 and output the result to another file:

opt -O2 {{path/to/file.bc}} -S -o {{path/to/output_file.bc}}