blob: 89d92e64f405a3b7cac49bbbffc4bb8929564540 [file] [log] [blame]
Chris Lattner1213bc72003-10-07 20:33:30 +00001<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>
Chris Lattner83273d52003-10-07 20:33:52 +000013<tt>bugpoint [options] [input llvm ll/bc files] [LLVM passes] --args &lt;program arguments&gt;...</tt>
Chris Lattner1213bc72003-10-07 20:33:30 +000014
15<img src="../Debugging.gif" width=444 height=314 align=right>
16<h3>DESCRIPTION</h3>
17
18The <tt>bugpoint</tt> tool is a generally useful tool for narrowing down
19problems in LLVM tools and passes.<p>
20
21<tt>bugpoint</tt> reads the specified list of .bc or .ll files specified on the
22command-line and links them together. It then runs the specified LLVM passes on
23the resultant bytecode file. If any of the passes crash, or if they produce an
24LLVM module which is not verifiable, bugpoint enters "crash debugging mode".
25Otherwise, <tt>bugpoint</tt> tries to run the resultant program with a code
26generator. If the code generated program does not match the reference output,
27it enters "miscompilation debugging mode". If the <tt>-mode</tt> option is
28specified, <tt>bugpoint</tt> enters "code generator debugging mode".
29
30<h4>Crash debugging mode</h4>
31
Misha Brukmana73bc8d2003-10-16 18:10:45 +000032If a pass crashes, bugpoint will try to narrow down the list of passes and the
33code to a more manageable amount.
34[unfinished]
Chris Lattner1213bc72003-10-07 20:33:30 +000035
36<h4>Miscompilation debugging mode</h4>
37
38TODO
39
40<h4>Code generator debugging mode</h4>
41
42TODO
43
44
45<h3>OPTIONS</h3>
46
47<ul>
48 <li><tt>-args &lt;arguments&gt;</tt>
49 <br>
50 All arguments specified after <tt>-args</tt> are passed into the
51 executed program when the program must be executed.
52 <p>
53
54 <li><tt>-disable-(adce,dce,final-cleanup,simplifycfg)</tt>
55 <br>
56 <tt>bugpoint</tt> uses several passes internally for cleanup routines to
57 reduce the size of the program. If you're trying to find a bug in out
58 of these passes, <tt>bugpoint</tt> may crash. These options tell
59 <tt>bugpoint</tt> not use the specified passes.
60 <p>
61
62 <li> <tt>-help</tt>
63 <br>
64 Print a summary of command line options.
65 <p>
66
67 <li> <tt>-input &lt;filename&gt;</tt>
68 <br>
69 Specify the contents of &lt;stdin&gt; when the program must be executed.
70 <p>
71
72 <li> <tt>-load &lt;plugin.so&gt;</tt>
73 <br>
74 Load the dynamic object plugin.so. This object should register new
75 optimization passes. Once loaded, the object will add new command line
76 options to enable various optimizations. To see the new complete list
77 of optimizations, use the -help and -load options together:
78 <p>
79 <tt>opt -load &lt;plugin.so&gt; -help</tt>
80 <p>
81
82 <li> <tt>-mode=(compile|codegen)</tt>
83 <br>
84 Specify whether <tt>bugpoint</tt> should operate in compilation
85 debugging mode (detecting miscompilations and optimizer crashes), or in
86 code generator debugging mode.
87 <p>
88
89 <li> <tt>-output &lt;filename&gt;</tt>
90 <br>
91 Specify a reference output for the &lt;stdout&gt; file stream.
92 <p>
93
94 <li> <tt>-run-(lli|jit|llc|cbe)</tt>
95 <br>
96 Specify which code generator <tt>bugpoint</tt> should use to run the
97 program with.
98 <p>
99
100</ul>
101
102<h3>EXIT STATUS</h3>
103
104If <tt>bugpoint</tt> succeeds in finding a problem, it will exit with 0.
105Otherwise, if an error occurs, it will exit with a non-zero value.
106
107<h3>SEE ALSO</h3>
108<a href="opt.html"><tt>opt</tt></a>
109<a href="analyze.html"><tt>analyze</tt></a>
110
111<HR>
112Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
113</body>
114</html>
115