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: