[LLVMdev] Adding option to LLVM opt to disable a specific pass from command line

Duncan Sands baldrick at free.fr
Sat Dec 10 06:05:28 PST 2011


Hi Tom,

> On 12/9/2011 8:23 AM, Seb wrote:
>> This thread is not to discuss how relevant this example is. I just would
>> like to know:
>> a) If people think that adding an option to disable a specific pass is
>> useful.
>
> Yes, a peer of mine recently wanted such an option to disable individual
> passes in order to 1) narrow in on a bug in one of them that affected
> stack back tracing, and 2) provide a workaround for the bug.  He didn't
> pursue modifying code to remove the passes one at a time and thus the
> bug remains hidden.

you don't have to modify code to reduce the list of passes.  Get clang (or
whatever) to produce unoptimized bitcode.  Check that running
   opt -std-compile-opts
(or opt -O3) or whatever reproduces the problem.  Adding -debug-pass=Arguments
will show you the list of passes used.  You can then run opt with this explicit
list of passes (rather than -std-compile-opts), and remove passes until you find
the problematic one.  Bugpoint can do this for you automatically.

Ciao, Duncan.



More information about the llvm-dev mailing list