From 6ff3310c49524ed9200d6f28a8fce23b1dca3273 Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Sun, 19 Oct 2003 17:30:36 +0000 Subject: [PATCH] Always say "the test program", part 2. Refer to the various "modules" of bugpoint as "debuggers", not "debugging modes" or "modules". I think this is more evocative of how they typically act, and it's shorter. Add a note about how a linker bug can crash bugpoint early. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9257 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/CommandGuide/bugpoint.html | 66 ++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/docs/CommandGuide/bugpoint.html b/docs/CommandGuide/bugpoint.html index 5593e57c5da..a37a15759c1 100644 --- a/docs/CommandGuide/bugpoint.html +++ b/docs/CommandGuide/bugpoint.html @@ -36,15 +36,15 @@ time for computer time in the compiler-debugging process; consequently, it may take a long period of (unattended) time to reduce a test case, but we feel it is still worth it. :-)

- -

Automatic Mode Selection

+ +

Automatic Debugger Selection

bugpoint reads each .bc or .ll file specified on the command line and links them together into a single module, called the test program. If any LLVM passes are specified on the command line, it runs these passes on the test program. If -any of the passes crash, or if they produce a malformed LLVM module, -bugpoint enters
crash debugging mode.

+any of the passes crash, or if they produce malformed output, +bugpoint starts the crash debugger.

Otherwise, if the -output option was not specified, bugpoint runs the test program with the C backend (which @@ -53,18 +53,18 @@ is assumed to generate good code) to generate a reference output. Once executing it with the selected code generator. If the resulting output differs from the reference output, it assumes the -difference resulted from a code generator failure, and enters -code generator debugging mode.

+difference resulted from a code generator failure, and starts the +code generator debugger.

Otherwise, bugpoint runs the test program after all of the LLVM passes have been applied to it. If its output differs from the reference output, it assumes the difference resulted from a failure in one of the LLVM passes, -and enters -miscompilation debugging mode. Otherwise, +and enters the +miscompilation debugger. Otherwise, there is no problem bugpoint can debug.

-

Crash debugging mode

+

Crash debugger

If an optimizer crashes, bugpoint will try as hard as it can to reduce the list of passes and the size of the test program. First, @@ -72,8 +72,9 @@ reduce the list of passes and the size of the test program. First, is useful when debugging a problem exposed by gccas, for example, because it runs over 25 optimizations.

-Next, bugpoint tries removing functions from the module, to reduce the -size of the test program. Usually it is able to reduce a test program +Next, bugpoint tries removing functions from the test program, to +reduce its +size. Usually it is able to reduce a test program to a single function, when debugging intraprocedural optimizations. Once the number of functions has been reduced, it attempts to delete various edges in the control @@ -85,36 +86,37 @@ reproduce the failure with opt or analyze.

-

Code generator debugging mode

+

Code generator debugger

The code generator debugger attempts to narrow down the amount of code that is being miscompiled by the
selected code generator. To do -this, it takes the LLVM program and partitions it into two pieces: one piece +this, it takes the test program and partitions it into two pieces: one piece which it compiles with the C backend (into a shared object), and one piece which it runs with either the JIT or the static LLC compiler. It uses several techniques to reduce the amount of code pushed through the LLVM code generator, to reduce the potential scope of the problem. After it is finished, it emits -two bytecode files (the "test" [to be compiled with the code generator] and -"safe" [to be compiled with the C backend] modules), and instructions for -reproducing the problem. This module assume the C backend produces good -code.

+two bytecode files (called "test" [to be compiled with the code generator] and +"safe" [to be compiled with the C backend] respectively), and instructions for +reproducing the problem. The code generator debugger assumes that the C +backend produces good code.

-If you are using this mode and get an error message that says "Non-instruction +If you are using the code generator debugger and get an error message that +says "Non-instruction is using an external function!", try using the -run-llc option instead of the -run-jit option. This is due to an unimplemented feature in the -code generator debugging mode.

+code generator debugger.

-

Miscompilation debugging mode

+

Miscompilation debugger

-The miscompilation debugging mode works similarly to the code generator -debugging mode. It works by splitting the program into two pieces, running the -optimizations specified on one piece, relinking the program, then executing it. +The miscompilation debugger works similarly to the code generator +debugger. It works by splitting the test program into two pieces, running the +optimizations specified on one piece, linking the two pieces back together, +and then executing the result. It attempts to narrow down the list of passes to the one (or few) which are -causing the miscompilation, then reduce the portion of the program which is -being miscompiled. This module assumes that the selected code generator is -working properly.

- +causing the miscompilation, then reduce the portion of the test program which is +being miscompiled. The miscompilation debugger assumes that the selected +code generator is working properly.

Advice for using bugpoint

@@ -123,14 +125,14 @@ working properly.

non-obvious ways. Here are some hints and tips:

    -
  1. In code generator and miscompilation debugging modes, bugpoint only +
  2. In the code generator and miscompilation debuggers, bugpoint only works with programs that have deterministic output. Thus, if the program outputs the date, time, or any other "random" data, bugpoint may misinterpret differences in these data, when output, as the result of a miscompilation. Programs should be temporarily modified to disable outputs that are likely to vary from run to run. -
  3. In code generator and miscompilation debugging modes, debugging will go +
  4. In the code generator and miscompilation debuggers, debugging will go faster if you manually modify the program or its inputs to reduce the runtime, but still exhibit the problem. @@ -147,9 +149,13 @@ non-obvious ways. Here are some hints and tips:


    to get a copy of bugpoint's output in the file bugpoint.log, as well as on your terminal.

    +

  5. bugpoint cannot debug problems with the linker. If + bugpoint crashes before you see its "All input ok" message, + you might try llvm-link -v on the same set of input files. If + that also crashes, you may be experiencing a linker bug. +
-

OPTIONS