[llvm-dev] Significant performance difference with a split call to opt

Sébastien Michelland via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 14 12:11:15 PDT 2019


Hello list,

This is a follow-up from a question I asked last month. I'm evaluating 
the performance of two pass sequences that resemble (but are not) -O3.

With -O3, -debug-pass=Structure prints several independent blocks that 
seem to represent several calls to opt. I focused on two of these 
blocks, say S1 and S2, and compared the following optimization methods:

1. Executing them separately, ie. opt -S1 | opt -S2
2. Executing them in a single call, ie. opt -S1 -S2

I built the test suite with each of these configurations, then measured 
the performance of the compiled programs with perf, over 10 runs.

I'm attaching a plot of the speedup of method 1 over method 2. The 
intervals represent the standard deviation of the performance measures.

As you can see, programs compiled with method 1 are significantly slower 
than their counterparts compiled with method 2. However, if passes were 
applied in order using function composition, their performance should be 
the same.

I'd like to know if there is a way to recover this property in the pass 
manager, or at least explain the difference. If needed, I can provide 
scripts to reproduce the measurements.

Thanks,
Sébastien Michelland
-------------- next part --------------
A non-text attachment was scrubbed...
Name: speedup-plot.png
Type: image/png
Size: 53411 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190614/0c7096f9/attachment.png>


More information about the llvm-dev mailing list