2 <title>LLVM: bugpoint tool</title>
6 <center><h1>LLVM: <tt>bugpoint</tt> tool</h1></center>
13 <tt>extract [options] [input llvm ll/bc files] [LLVM passes] --args <program arguments>...</tt>
15 <img src="../Debugging.gif" width=444 height=314 align=right>
18 The <tt>bugpoint</tt> tool is a generally useful tool for narrowing down
19 problems in LLVM tools and passes.<p>
21 <tt>bugpoint</tt> reads the specified list of .bc or .ll files specified on the
22 command-line and links them together. It then runs the specified LLVM passes on
23 the resultant bytecode file. If any of the passes crash, or if they produce an
24 LLVM module which is not verifiable, bugpoint enters "crash debugging mode".
25 Otherwise, <tt>bugpoint</tt> tries to run the resultant program with a code
26 generator. If the code generated program does not match the reference output,
27 it enters "miscompilation debugging mode". If the <tt>-mode</tt> option is
28 specified, <tt>bugpoint</tt> enters "code generator debugging mode".
30 <h4>Crash debugging mode</h4>
34 <h4>Miscompilation debugging mode</h4>
38 <h4>Code generator debugging mode</h4>
46 <li><tt>-args <arguments></tt>
48 All arguments specified after <tt>-args</tt> are passed into the
49 executed program when the program must be executed.
52 <li><tt>-disable-(adce,dce,final-cleanup,simplifycfg)</tt>
54 <tt>bugpoint</tt> uses several passes internally for cleanup routines to
55 reduce the size of the program. If you're trying to find a bug in out
56 of these passes, <tt>bugpoint</tt> may crash. These options tell
57 <tt>bugpoint</tt> not use the specified passes.
62 Print a summary of command line options.
65 <li> <tt>-input <filename></tt>
67 Specify the contents of <stdin> when the program must be executed.
70 <li> <tt>-load <plugin.so></tt>
72 Load the dynamic object plugin.so. This object should register new
73 optimization passes. Once loaded, the object will add new command line
74 options to enable various optimizations. To see the new complete list
75 of optimizations, use the -help and -load options together:
77 <tt>opt -load <plugin.so> -help</tt>
80 <li> <tt>-mode=(compile|codegen)</tt>
82 Specify whether <tt>bugpoint</tt> should operate in compilation
83 debugging mode (detecting miscompilations and optimizer crashes), or in
84 code generator debugging mode.
87 <li> <tt>-output <filename></tt>
89 Specify a reference output for the <stdout> file stream.
92 <li> <tt>-run-(lli|jit|llc|cbe)</tt>
94 Specify which code generator <tt>bugpoint</tt> should use to run the
102 If <tt>bugpoint</tt> succeeds in finding a problem, it will exit with 0.
103 Otherwise, if an error occurs, it will exit with a non-zero value.
106 <a href="opt.html"><tt>opt</tt></a>
107 <a href="analyze.html"><tt>analyze</tt></a>
110 Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.