blob: 1bdacc7dac6b2df0837cc936ee633ac66e9f507c [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,
John Criswell589d91f2003-10-16 20:15:17 +000027it enters "miscompilation debugging mode".
Chris Lattner1213bc72003-10-07 20:33:30 +000028
29<h4>Crash debugging mode</h4>
30
Misha Brukmana73bc8d2003-10-16 18:10:45 +000031If a pass crashes, bugpoint will try to narrow down the list of passes and the
Misha Brukmane610cbb2003-10-16 18:13:19 +000032code 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.
Misha Brukman3f717222003-10-16 18:14:43 +000034
Misha Brukmana73bc8d2003-10-16 18:10:45 +000035[unfinished]
Chris Lattner1213bc72003-10-07 20:33:30 +000036
37<h4>Miscompilation debugging mode</h4>
38
39TODO
40
41<h4>Code generator debugging mode</h4>
42
43TODO
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
John Criswell589d91f2003-10-16 20:15:17 +000058 reduce the size of the program. If you're trying to find a bug in one
Chris Lattner1213bc72003-10-07 20:33:30 +000059 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
Chris Lattner1213bc72003-10-07 20:33:30 +000083 <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
John Criswell589d91f2003-10-16 20:15:17 +000091 program.
Chris Lattner1213bc72003-10-07 20:33:30 +000092 <p>
93
94</ul>
95
96<h3>EXIT STATUS</h3>
97
98If <tt>bugpoint</tt> succeeds in finding a problem, it will exit with 0.
99Otherwise, if an error occurs, it will exit with a non-zero value.
100
101<h3>SEE ALSO</h3>
John Criswell589d91f2003-10-16 20:15:17 +0000102<a href="opt.html"><tt>opt</tt></a>,
Chris Lattner1213bc72003-10-07 20:33:30 +0000103<a href="analyze.html"><tt>analyze</tt></a>
104
105<HR>
106Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
107</body>
108</html>
109