using bugpoint in a complex ruby code build case

Hi all,

I've been running into what appears to be an optimization bug in llvm, while compiling
the latest ruby 1.9.3 with the latest llvm/clang 2.9 version. From hands on experimentation
I do know that the gvn pass for the "vm.c" compilation is the culprit of the miscompilation
(clang -O2/-O3 options produce the miscompilation, however -O1 is fine!). I've also tried
to generate an non-optimized bc file with clang first, then run the optimization steps
that come with the -O3 option then dropping the "gvn" pass. All this confirms the hypothesis.

Due to the lack of bugpoint examples in the documentation, I have no idea how to use bugpoint
in this complex case, where vm.o firstly needs to be linked with lots of other compiled modules
and libraries, then the resulting program needs to be executed with some parameters!

Also, if bugpoint were to be able to deal with this complex scenario, how could one provide
hints to bugpoint not to try everything, but to focus on certain llvm steps?

Thanks,
Frank

Due to the lack of bugpoint examples in the documentation, I have no
idea how to use bugpoint
in this complex case, where vm.o firstly needs to be linked with lots
of other compiled modules
and libraries, then the resulting program needs to be executed with
some parameters!

It should be possible. I did something like that for debugging a clang
bootstrap. What I did was link all the other files and libraries into
a single .o with "ld -r" and pass it with -Xlinker.

Also, if bugpoint were to be able to deal with this complex scenario,
how could one provide
hints to bugpoint not to try everything, but to focus on certain llvm
steps?

Thanks,
Frank

Cheers,
Rafael

It should be possible. I did something like that for debugging a clang
bootstrap. What I did was link all the other files and libraries into
a single .o with "ld -r" and pass it with -Xlinker.

It is also possible to use -Xlinker many times, as in
   -Xlinker=obj_file1.o -Xlinker=obj_file2.o ... -Xlinker=library_1.a ...

Also, if bugpoint were to be able to deal with this complex scenario,
how could one provide
hints to bugpoint not to try everything, but to focus on certain llvm
steps?

You can give it an explicit set of passes to run.

Ciao,

Duncan.