xref: /llvm-project/polly/docs/Performance.rst (revision cd4d873d159378f032da2033f33fc786f7e196bb)
1.. include:: <isonum.txt>
2==================================================
3Performance
4==================================================
5
6High-Performance Generalized Matrix Multiplication
7--------------------------------------------------
8
9Polly automatically detects and optimizes generalized matrix multiplication,
10the computation C |larr| α ⊗ C ⊕ β ⊗ A ⊗ B, where A, B, and C are three appropriately sized matrices,
11⊕ and ⊗ operations are originating from the corresponding matrix semiring, and α and β are
12constants, and beta is not equal to zero. It allows to obtain the highly optimized form structured
13similar to the expert implementation of GEMM that can be found in GotoBLAS and its successors. The
14performance evaluation of GEMM is shown in the following figure.
15
16
17    .. image:: images/GEMM_double.png
18       :align: center
19
20
21
22Compile Time Impact of Polly
23----------------------------
24
25Clang+LLVM+Polly are compiled using Clang on a Intel(R) Core(TM) i7-7700 based system. The experiment
26is repeated twice: with and without Polly enabled in order to measure its compile time impact.
27
28The following versions are used:
29
30
31- Polly (git hash 0db98a4837b6f233063307bb9184374175401922)
32- Clang (git hash 3e1d04a92b51ed36163995c96c31a0e4bbb1561d)
33- LLVM  git hash 0265ec7ebad69a47f5c899d95295b5eb41aba68e)
34
35`ninja <https://ninja-build.org/>`_ is used as the build system.
36
37For both cases the whole compilation was performed five times. The compile times in seconds are shown in the following table.
38
39+--------------+-------------+
40|Polly Disabled|Polly Enabled|
41+==============+=============+
42|964           |977          |
43+--------------+-------------+
44|964           |980          |
45+--------------+-------------+
46|967           |981          |
47+--------------+-------------+
48|967           |981          |
49+--------------+-------------+
50|968           |982          |
51+--------------+-------------+
52
53
54The median compile time without Polly enabled is 967 seconds and with Polly enabled it is 981 seconds. The overhead is 1.4%.
55
56