# LLVM: `bugpoint` tool

### NAME

`bugpoint`

### SYNOPSIS

`bugpoint [options] [input llvm ll/bc files] [LLVM passes] --args <program arguments>...`

### DESCRIPTION

The `bugpoint` tool is a generally useful tool for narrowing down problems in LLVM tools and passes.

`bugpoint` reads the specified list of .bc or .ll files specified on the command-line and links them together. It then runs the specified LLVM passes on the resultant bytecode file. If any of the passes crash, or if they produce an LLVM module which is not verifiable, bugpoint enters "crash debugging mode". Otherwise, `bugpoint` tries to run the resultant program with a code generator. If the code generated program does not match the reference output, it enters "miscompilation debugging mode". If the `-mode` option is specified, `bugpoint` enters "code generator debugging mode".

#### Crash debugging mode

TODO

#### Miscompilation debugging mode

TODO

#### Code generator debugging mode

TODO

### OPTIONS

- `-args <arguments>`
  All arguments specified after `-args` are passed into the executed program when the program must be executed.

- `-disable-(adce,dce,final-cleanup,simplifycfg)`
  `bugpoint` uses several passes internally for cleanup routines to reduce the size of the program. If you're trying to find a bug in out of these passes, `bugpoint` may crash. These options tell `bugpoint` not use the specified passes.

- `-help`
  Print a summary of command line options.

- `-input <filename>`
  Specify the contents of <stdin> when the program must be executed.

- `-load <plugin.so>`
  Load the dynamic object plugin.so. This object should register new optimization passes. Once loaded, the object will add new command line options to enable various optimizations. To see the new complete list of optimizations, use the -help and -load options together:

  `opt -load <plugin.so> -help`

- `-mode=(compile|codegen)`
  Specify whether `bugpoint` should operate in compilation debugging mode (detecting miscompilations and optimizer crashes), or in code generator debugging mode.

- `-output <filename>`
  Specify a reference output for the <stdout> file stream.

- `-run-(lli|jit|llc|cbe)`
  Specify which code generator `bugpoint` should use to run the program with.

### EXIT STATUS

If `bugpoint` succeeds in finding a problem, it will exit with 0. Otherwise, if an error occurs, it will exit with a non-zero value.

### SEE ALSO

`opt` `analyze`

Maintained by the LLVM Team.