[llvm-dev] Calling a script from a script in a lit test
Sean Silva via llvm-dev
llvm-dev at lists.llvm.org
Wed Apr 6 18:06:38 PDT 2016
On Wed, Apr 6, 2016 at 2:34 PM, Kaylor, Andrew via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> I’m trying to put together some tests for the optimization bisecting
> feature I’m working on and I’ve come across a stumbling block trying to
> accomplish something in a lit test.
>
>
>
> I’ve got an IR file with some simple functions, one of which includes a
> call to another function that will be inlined during optimization. I can
> use this to manually test my new OptBisect class by invoking the existing
> utils/bisect file in the following way:
>
>
>
> python <llvm_scr_root>/utils/bisect --start=0 --end=200 test.sh
> %(count)s
>
>
>
> with ‘test.sh’ looking like this:
>
>
>
> opt -O2 -opt-bisect-limit=%1 -S opt-bisect.ll | FileCheck
> opt-bisect.ll --check-prefix=CHECK-BISECT-INLINE
>
>
>
> and ‘opt-bisect.ll’ looking (more or less) like this:
>
>
>
> ; CHECK-BISECT-INLINE: call i32 @f1()
>
> define i32 @f1() {
>
> entry:
>
> ret i32 0
>
> }
>
>
>
> define i32 @f2() {
>
> entry:
>
> %temp = call i32 @f1()
>
> ret i32 %temp
>
> }
>
>
>
> From a command shell that does exactly what I want it to and converges on
> the inlining optimization. So my question is, how can I accomplish that
> same thing in the form of a lit test. I feel like it’s really close, but I
> don’t know (1) how to find utils/bisect properly from the lit test,
>
You can probably add a lit substitution %llvm_src_root if we don't have one.
(The generated files build_dir/bin/llvm-lit.py (or build_dir/bin/llvm-lit)
already know it, so that information should be available to lit I think)
> and (2) how to get the piping at the right level on the run line (or into
> a secondary script that will work on all platforms.
>
You can always just put files in %S/Inputs/
-- Sean Silva
>
>
> Can anyone help me out?
>
>
>
> Thanks,
>
> Andy
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160406/d926ef60/attachment.html>
More information about the llvm-dev
mailing list