[llvm-dev] bugpoint --tool-args and --safe-tool-args

David A. Greene via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 1 07:56:57 PDT 2018


Thanks for the pointer!

Unfortunately, I am not sure this will help.  Right now I've got a bad
code generator.  I would like to use the code generator mode to pinpoint
where in the test it is going wrong.  The blog post talks about testcase
reduction, which isn't quite what I need.  I need the splitting behavior
of the code generator mode, which I'm not sure -compile-custom supports.
I'll give it a go and see what happens.

That post talks about the confusing nature of bugpoint and I have to
agree.  I'm thinking about writing up an RFC to improve the user
experience but I've got to find time to do it.  :)

                               -David

Sean Silva <chisophugis at gmail.com> writes:

> Have you read
> http://blog.llvm.org/2015/11/reduce-your-testcases-with-bugpoint-and.html?
> m=1 ?
>
> That's how I always use bugpoint and have done things like this. I
> always seem to have to brush up my bash skills every time I use it.
>
> On Tue, Jul 31, 2018, 1:47 PM David A. Greene via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
>
>     Ugh. Scripts won't work either, at least not by default. The
>     problem
>     is that I need non-default options for both the safe and unsafe
>     compiler.
>     
>     I hacked in an -unsafe-path option to let me point to a script for
>     the
>     "bad" compiler. We'll see if that works. If it does, would it be a
>     useful addition?
>     
>     -David
>     
>     Matthias Braun <mbraun at apple.com> writes:
>     
>     > This is what works for me, when I want to reduce an llc failure
>     > triggering a failure with a "foo bar baz" in the assert message
>     (the
>     > grep for the error message avoids reducing to an unrelated
>     failure):
>     >
>     > $ cat run_llc.sh
>     > #!/bin/sh
>     > if ! $HOME/dev/llvm/build/bin/llc "$@" 2>&1 | grep "foo bar
>     baz"; then
>     > exit 0
>     > else
>     > exit $?
>     > fi
>     >
>     > $ PATH=$HOME/path/to/my/llvm/build/bin:$PATH bugpoint -
>     compile-custom -
>     > compile-command ./run_llc.sh test.ll
>     >
>     > - Matthias
>     >
>     > On Jul 31, 2018, at 11:03 AM, Friedman, Eli via llvm-dev
>     > <llvm-dev at lists.llvm.org> wrote:
>     >
>     > 
>     > On 7/31/2018 10:10 AM, David Greene via llvm-dev wrote:
>     > 
>     > I have a failing test and bugpoint would be the perfect tool to
>     > help
>     > narrow it down.
>     > 
>     > llc is the failing tool. It fails with one set of options and
>     > passes
>     > with another. I was hoping to use bugpoint like this:
>     > 
>     > bugpoint -safe-llc -run-llc <testcase> -tool-args <failing
>     > args> -safe-tool-args <passing args>
>     > 
>     > Unfortunately, this doesn't seem to be possible. According to
>     > the
>     > documentation both -tool-args and -safe-tool-args consume all
>     > remaining
>     > arguments so bugpoint would never see -safe-tool-args above.
>     > 
>     > I tried it and indeed it looks like -safe-tool-args never
>     > makes it to
>     > llc.
>     > 
>     > For now I can build another llc which makes <failing args>
>     > default and
>     > then just use -safe-tool-args above but it's a bit painful.
>     > 
>     > Has anyone tried to use bugpoint like this before? Any tips?
>     >
>     > I've occasionally used shell script wrappers when I couldn't get
>     > bugpoint command-line parsing to work the way I wanted it to.
>     > 
>     > Looking at CommandLine.rst, PositionalEatsArgs is supposed to
>     > allow specifying something like the command you wrote, but I'm
>     not
>     > sure it ever worked correctly; nothing other than bugpoint uses
>     > it, as far as I can tell.
>     > 
>     > -Eli
>     > 
>     > -- 
>     > Employee of Qualcomm Innovation Center, Inc.
>     > Qualcomm Innovation Center, Inc. is a member of Code Aurora
>     Forum,
>     > a Linux Foundation Collaborative Project
>     > 
>     > _______________________________________________
>     > LLVM Developers mailing list
>     > llvm-dev at lists.llvm.org
>     > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>     _______________________________________________
>     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