[llvm-dev] Are there any tools to reduce the IR file that caused a problem?

Fedor Sergeev via llvm-dev llvm-dev at lists.llvm.org
Sun Nov 11 05:24:16 PST 2018


In many cases the problem is indeed in a single pass, so finding exact 
pass is rather beneficial.

If you *really* want to stick to a particular sequence of passes you can 
feed bugpoint with a custom script
that takes IR and does what you need.
The tricky part is how to control bugpoint, since sometimes it behaves 
somewhat unobvious.
I usually use exit code 134, which for bugpoint means crash:

] cat bugpoint-custom-simple.sh
opt -do-what-you-want-here "$@"  ; run something else if needed
[[ problem reproduced ]] && echo "Problem reproduces!" && exit 134
exit 0
] bugpoint -compile-custom -compile-command=./bugpoint-custom-check.sh 
bad.ll

regards,
   Fedor.

On 11/11/18 9:56 AM, cszide via llvm-dev wrote:
> Hi everyone,
> I want to test the passes in llvm, and I got some passes sequences 
> that caused the crash of opt.
> Although I can use bugpoint to narrow down the source of problems, I 
> can only get some reduced and
> simplified IR and passes to reproduce the problem. My question is how 
> to get the reduced IR of the original IR
> file to reproduce the problem. For example,
> "opt a.bc -a -b -c -d (where a, b, c and d are passes)" has a crash 
> problem caused by "-a -b -c -d", so we can use
> bugpoint to narrow down the source of problems, thus bugpoint will 
> tell us "You can reproduce the problem with:
> opt bugpoint-reduced-simplified.bc -c". However, for the 
> "bugpoint-reduced-simplified.bc", I do not know the actual wrong points
> of the original "a.bc", and the pass "-c" is good for "a.bc", the 
> actual wrong passes sequence is "-b -c" for "a.bc", i.e., we need to 
> run pass "-b" before
> pass "-c" to reproduce the problem on the original IR file.
> So how to reduce the original IR and get the actual wrong passes 
> sequence? Are there any tools? Or there are some special tips of bugpoint
> for this purpose?
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list