Removed the -mode option.
[oota-llvm.git] / docs / CommandGuide / bugpoint.html
1 <html>
2 <title>LLVM: bugpoint tool</title>
3
4 <body bgcolor=white>
5
6 <center><h1>LLVM: <tt>bugpoint</tt> tool</h1></center>
7 <HR>
8
9 <h3>NAME</h3>
10 <tt>bugpoint</tt>
11
12 <h3>SYNOPSIS</h3>
13 <tt>bugpoint [options] [input llvm ll/bc files] [LLVM passes] --args &lt;program arguments&gt;...</tt>
14
15 <img src="../Debugging.gif" width=444 height=314 align=right>
16 <h3>DESCRIPTION</h3>
17
18 The <tt>bugpoint</tt> tool is a generally useful tool for narrowing down
19 problems in LLVM tools and passes.<p>
20
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".
28
29 <h4>Crash debugging mode</h4>
30
31 If a pass crashes, bugpoint will try to narrow down the list of passes and the
32 code to a more manageable amount. Using a sophisticated binary-search algorithm,
33 <tt>bugpoint</tt> pares down the list of passes to a minimum set.
34
35 [unfinished]
36
37 <h4>Miscompilation debugging mode</h4>
38
39 TODO
40
41 <h4>Code generator debugging mode</h4>
42
43 TODO
44
45
46 <h3>OPTIONS</h3>
47
48 <ul>
49         <li><tt>-args &lt;arguments&gt;</tt>
50         <br>
51         All arguments specified after <tt>-args</tt> are passed into the
52         executed program when the program must be executed.
53         <p>
54
55         <li><tt>-disable-(adce,dce,final-cleanup,simplifycfg)</tt>
56         <br>
57         <tt>bugpoint</tt> uses several passes internally for cleanup routines to
58         reduce the size of the program.  If you're trying to find a bug in one
59         of these passes, <tt>bugpoint</tt> may crash.  These options tell
60         <tt>bugpoint</tt> not use the specified passes.
61         <p>
62
63         <li> <tt>-help</tt>
64         <br>
65         Print a summary of command line options.
66         <p>
67
68         <li> <tt>-input &lt;filename&gt;</tt>
69         <br>
70         Specify the contents of &lt;stdin&gt; when the program must be executed.
71         <p>
72
73         <li> <tt>-load &lt;plugin.so&gt;</tt>
74         <br>
75         Load the dynamic object plugin.so.  This object should register new
76         optimization passes.  Once loaded, the object will add new command line
77         options to enable various optimizations.  To see the new complete list
78         of optimizations, use the -help and -load options together:
79         <p>
80         <tt>opt -load  &lt;plugin.so&gt; -help</tt>
81         <p>
82
83         <li> <tt>-output &lt;filename&gt;</tt>
84         <br>
85         Specify a reference output for the &lt;stdout&gt; file stream.
86         <p>
87
88         <li> <tt>-run-(lli|jit|llc|cbe)</tt>
89         <br>
90         Specify which code generator <tt>bugpoint</tt> should use to run the
91         program.
92         <p>
93
94 </ul>
95
96 <h3>EXIT STATUS</h3>
97
98 If <tt>bugpoint</tt> succeeds in finding a problem, it will exit with 0.
99 Otherwise, if an error occurs, it will exit with a non-zero value.
100
101 <h3>SEE ALSO</h3>
102 <a href="opt.html"><tt>opt</tt></a>,
103 <a href="analyze.html"><tt>analyze</tt></a>
104
105 <HR>
106 Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
107 </body>
108 </html>
109