2016-03-25 22:22:53 +08:00
|
|
|
========================
|
|
|
|
Release Notes (upcoming)
|
|
|
|
========================
|
2016-02-04 16:10:29 +08:00
|
|
|
|
|
|
|
In Polly 3.9 the following important changes have been incorporated.
|
|
|
|
|
2016-03-25 22:22:53 +08:00
|
|
|
.. warning::
|
|
|
|
|
|
|
|
These releaes notes are for the next release of Polly and describe
|
|
|
|
the new features that have recently been committed to our development
|
|
|
|
branch.
|
|
|
|
|
Support accesses with differently sized types to the same array
This allows code such as:
void multiple_types(char *Short, char *Float, char *Double) {
for (long i = 0; i < 100; i++) {
Short[i] = *(short *)&Short[2 * i];
Float[i] = *(float *)&Float[4 * i];
Double[i] = *(double *)&Double[8 * i];
}
}
To model such code we use as canonical element type of the modeled array the
smallest element type of all original array accesses, if type allocation sizes
are multiples of each other. Otherwise, we use a newly created iN type, where N
is the gcd of the allocation size of the types used in the accesses to this
array. Accesses with types larger as the canonical element type are modeled as
multiple accesses with the smaller type.
For example the second load access is modeled as:
{ Stmt_bb2[i0] -> MemRef_Float[o0] : 4i0 <= o0 <= 3 + 4i0 }
To support code-generating these memory accesses, we introduce a new method
getAccessAddressFunction that assigns each statement instance a single memory
location, the address we load from/store to. Currently we obtain this address by
taking the lexmin of the access function. We may consider keeping track of the
memory location more explicitly in the future.
We currently do _not_ handle multi-dimensional arrays and also keep the
restriction of not supporting accesses where the offset expression is not a
multiple of the access element type size. This patch adds tests that ensure
we correctly invalidate a scop in case these accesses are found. Both types of
accesses can be handled using the very same model, but are left to be added in
the future.
We also move the initialization of the scop-context into the constructor to
ensure it is already available when invalidating the scop.
Finally, we add this as a new item to the 2.9 release notes
Reviewers: jdoerfert, Meinersbur
Differential Revision: http://reviews.llvm.org/D16878
llvm-svn: 259784
2016-02-04 21:18:42 +08:00
|
|
|
Increased analysis coverage
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
Polly's modeling has been improved to increase the applicability of Polly. The
|
|
|
|
following code pieces are newly supported:
|
|
|
|
|
|
|
|
Arrays accessed through different types
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
It is not uncommon that one array stores elements of different types. Polly now
|
|
|
|
can model and optimize such code.
|
|
|
|
|
|
|
|
.. code-block:: c
|
|
|
|
|
|
|
|
void multiple_types(char *Short, char *Float, char *Double) {
|
|
|
|
for (long i = 0; i < 100; i++) {
|
|
|
|
Short[i] = *(short *)&Short[2 * i];
|
|
|
|
Float[i] = *(float *)&Float[4 * i];
|
|
|
|
Double[i] = *(double *)&Double[8 * i];
|
|
|
|
}
|
|
|
|
}
|
2016-02-04 16:10:29 +08:00
|
|
|
|
2016-03-03 19:33:30 +08:00
|
|
|
|
|
|
|
If the accesses are not aligned with the size of the access type we model them
|
|
|
|
as multiple accesses to an array of smaller elements. This is especially
|
2016-03-04 03:48:30 +08:00
|
|
|
useful for structs containing different typed elements as accesses to them are
|
2016-03-03 19:33:30 +08:00
|
|
|
represented using only one base pointer, namely the ``struct`` itself. In the
|
|
|
|
example below the accesses to ``s`` are all modeled as if ``s`` was a single
|
|
|
|
char array because the accesses to ``s->A`` and ``s->B`` are not aligned with
|
|
|
|
their respective type size (both are off-by-one due to the ``char`` field in
|
|
|
|
the ``struct``).
|
|
|
|
|
|
|
|
.. code-block:: c
|
|
|
|
|
|
|
|
struct S {
|
|
|
|
char Offset;
|
|
|
|
int A[100];
|
|
|
|
double B[100];
|
|
|
|
};
|
|
|
|
|
|
|
|
void struct_accesses(struct S *s) {
|
|
|
|
for (long i = 0; i < 100; i++)
|
|
|
|
s->B[i] += s->A[i];
|
|
|
|
}
|
|
|
|
|
2016-03-03 19:33:49 +08:00
|
|
|
|
|
|
|
|
|
|
|
Function calls with known side effects
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
Function calls that have only known memory effects can be represented as
|
|
|
|
accesses in the polyhedral model. While calls without side effects were
|
|
|
|
supported before, we now allow and model two other kinds. The first are
|
|
|
|
intrinsic calls to ``memcpy``, ``memmove`` and ``memset``. These calls can be
|
|
|
|
represented precisely if the pointers involved are known and the given length
|
|
|
|
is affine. Additionally, we allow to over-approximate function calls that are
|
2016-03-04 03:48:30 +08:00
|
|
|
known only to read memory, read memory accessible through pointer arguments or
|
|
|
|
access only memory accessible through pointer arguments. See also the function
|
2016-03-03 19:33:49 +08:00
|
|
|
attributes ``readonly`` and ``argmemonly`` for more information.
|
|
|
|
|
|
|
|
|
2016-02-04 16:10:29 +08:00
|
|
|
Update of the isl math library
|
|
|
|
------------------------------
|
|
|
|
|
|
|
|
We imported the latest version of the isl math library into Polly.
|
|
|
|
|