pet_context_evaluate_expr: plug in affine expressions outside index expressions
commit4104a474fdcb6b6ec5bc59a97e18554c84556d53
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 27 Apr 2014 19:32:08 +0000 (27 21:32 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 7 Mar 2016 11:13:53 +0000 (7 12:13 +0100)
tree5ad54db1d47a9745a18fccc858003fd53c866115
parent9bc7e86f3a914c8dd67fd79c28de5231b053b7b9
pet_context_evaluate_expr: plug in affine expressions outside index expressions

pet_context_evaluate_expr already detects affine expressions inside
access subexpressions in order to be able to integrate the arguments
in its index expression.
Also detect such affine expressions outside of access subexpressions.
This allows several affine expressions to be combined into a single
affine expression, which can then later be simplified as a whole
during pretty printing.

The detection of subexpressions that can be converted into
an affine expression is performed top-down just in case
the expression contains a comparison with a min or a max
as arguments.  The conversion of such a comparison can
be optimized if the min an max expressions are still
explicitly available, but not when these have already
been converted to an affine expression since isl currently
does not keep track of the min and max expression explicitly.
The top-down conversion means that some subexpressions may
be considered several times, but the results will then already
be available in the cache of extracted affine expressions.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
20 files changed:
context.c
tests/break.scop
tests/break2.scop
tests/break3.scop
tests/break4.scop
tests/break5.scop
tests/conditional_assignment.scop
tests/conditional_assignment2.scop
tests/continue.scop
tests/data_dependent.scop
tests/data_dependent2.scop
tests/dynamic_bound.scop
tests/independent1.scop
tests/independent2.scop
tests/independent3.scop
tests/independent4.scop
tests/inline5.scop
tests/mod2.scop
tests/propagate.scop
tests/struct3.scop