<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Passing -print-after-all to opt should print the IR after each pass. That may help figure out what's going on.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 17, 2019 at 1:30 PM Sébastien Michelland via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I reproduced the test on many individual files and got very variable <br>
results... it seems the computer's workload when running the test suite <br>
influenced the execution speed a lot more than standard deviation shows. <br>
I'll withdraw the performance claim until I can get consistent results <br>
(changed subject line), apologies for the confusion.<br>
<br>
What I can still show easily is that the code generated by these two <br>
methods is different (which is already weird). For a simple example, <br>
grab a copy of bilateral_grid.bc:<br>
<br>
<br>
<<a href="https://github.com/llvm/llvm-test-suite/blob/master/Bitcode/Benchmarks/Halide/bilateral_grid/bilateral_grid.bc" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-test-suite/blob/master/Bitcode/Benchmarks/Halide/bilateral_grid/bilateral_grid.bc</a>><br>
<br>
Then you can generate my sequences with [opt -O3 -debug-pass=Arguments] <br>
and diff the outputs. Please see the attached script.<br>
<br>
The differences seem to be mainly on variable indices (are they <br>
randomized?); on some test (namely jacobi-2d-imper) I have seen calling <br>
convention differences.<br>
<br>
I'd like to optimize programs by greedily selecting optimizations, <br>
making a call to opt at each step. If I don't have equality between the <br>
two methods, I can't be sure that the sequence I'm building will make <br>
much sense.<br>
<br>
Sébastien Michelland<br>
<br>
On 6/14/19 4:49 PM, David Greene wrote:<br>
> Do you have more information?  What were the exact command lines you<br>
> used?  Do you have an example program that demonstrates the difference<br>
> than you can share?<br>
> <br>
>                        -David<br>
> <br>
> Sébastien Michelland via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> writes:<br>
> <br>
>> Hello list,<br>
>><br>
>> This is a follow-up from a question I asked last month. I'm evaluating<br>
>> the performance of two pass sequences that resemble (but are not) -O3.<br>
>><br>
>> With -O3, -debug-pass=Structure prints several independent blocks that<br>
>> seem to represent several calls to opt. I focused on two of these<br>
>> blocks, say S1 and S2, and compared the following optimization<br>
>> methods:<br>
>><br>
>> 1. Executing them separately, ie. opt -S1 | opt -S2<br>
>> 2. Executing them in a single call, ie. opt -S1 -S2<br>
>><br>
>> I built the test suite with each of these configurations, then<br>
>> measured the performance of the compiled programs with perf, over 10<br>
>> runs.<br>
>><br>
>> I'm attaching a plot of the speedup of method 1 over method 2. The<br>
>> intervals represent the standard deviation of the performance<br>
>> measures.<br>
>><br>
>> As you can see, programs compiled with method 1 are significantly<br>
>> slower than their counterparts compiled with method 2. However, if<br>
>> passes were applied in order using function composition, their<br>
>> performance should be the same.<br>
>><br>
>> I'd like to know if there is a way to recover this property in the<br>
>> pass manager, or at least explain the difference. If needed, I can<br>
>> provide scripts to reproduce the measurements.<br>
>><br>
>> Thanks,<br>
>> Sébastien Michelland<br>
>><br>
>><br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>