1========================
2Release Notes (upcoming)
3========================
4
5In Polly 3.9 the following important changes have been incorporated.
6
7.. warning::
8
9  These releaes notes are for the next release of Polly and describe
10  the new features that have recently been committed to our development
11  branch.
12
13Polly directly available in clang/opt/bugpoint
14----------------------------------------------
15
16Polly supported since a long time to be directly linked into tools such as
17opt/clang/bugpoint. Since this release, the default for a source checkout that
18contains Polly is to provide Polly directly through these tools, rather than as
19an additional module. This makes using Polly significantly easier.
20
21Instead of
22
23.. code-block:: bash
24
25    opt -load lib/LLVMPolly.so -O3 -polly file.ll
26    clang -Xclang -load -Xclang lib/LLVMPolly.so -O3 -mllvm -polly file.ll
27
28one can now use
29
30.. code-block:: bash
31
32    opt -O3 -polly file.ll
33    clang -O3 -mllvm -polly file.c
34
35
36Increased analysis coverage
37---------------------------
38
39Polly's modeling has been improved to increase the applicability of Polly. The
40following code pieces are newly supported:
41
42Arrays accessed through different types
43^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44
45It is not uncommon that one array stores elements of different types. Polly now
46can model and optimize such code.
47
48.. code-block:: c
49
50    void multiple_types(char *Short, char *Float, char *Double) {
51      for (long i = 0; i < 100; i++) {
52        Short[i] = *(short *)&Short[2 * i];
53        Float[i] = *(float *)&Float[4 * i];
54        Double[i] = *(double *)&Double[8 * i];
55      }
56    }
57
58
59If the accesses are not aligned with the size of the access type we model them
60as multiple accesses to an array of smaller elements. This is especially
61useful for structs containing different typed elements as accesses to them are
62represented using only one base pointer, namely the ``struct`` itself.  In the
63example below the accesses to ``s`` are all modeled as if ``s`` was a single
64char array because the accesses to ``s->A`` and ``s->B`` are not aligned with
65their respective type size (both are off-by-one due to the ``char`` field in
66the ``struct``).
67
68.. code-block:: c
69
70    struct S {
71      char Offset;
72      int A[100];
73      double B[100];
74    };
75
76    void struct_accesses(struct S *s) {
77      for (long i = 0; i < 100; i++)
78        s->B[i] += s->A[i];
79    }
80
81
82
83Function calls with known side effects
84^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85
86Function calls that have only known memory effects can be represented as
87accesses in the polyhedral model. While calls without side effects were
88supported before, we now allow and model two other kinds. The first are
89intrinsic calls to ``memcpy``, ``memmove`` and ``memset``. These calls can be
90represented precisely if the pointers involved are known and the given length
91is affine. Additionally, we allow to over-approximate function calls that are
92known only to read memory, read memory accessible through pointer arguments or
93access only memory accessible through pointer arguments. See also the function
94attributes ``readonly`` and ``argmemonly`` for more information.
95
96Fine-grain dependences analysis
97-------------------------------
98
99In addition of the ScopStmt wise dependences analysis, now the "polly-dependence"
100pass provides dependences analysis at memory reference wise and memory access wise.
101The memory reference wise analysis distinguishes the accessed references in the
102same statement, and generates dependences relationships between (statement, reference)
103pairs. The memory access wise analysis distinguishes accesses in the same statement,
104and generates dependences relationships between (statement, access) pairs. These
105fine-grain dependences are enabled by "-polly-dependences-analysis-level=reference-wise"
106and "-polly-dependences-analysis-level=access-wise", respectively.
107
108Update of the isl math library
109------------------------------
110
111We imported the latest version of the isl math library into Polly.
112
113