isl_ast_expr_from_aff: try harder to use isl_ast_op_pdiv_{q,r}
When generating C code, we prefer to generate "/" (or "%") rather
than "floord" because "floord" has an implicit condition on the
sign of the first argument.
We would already generate isl_ast_op_pdiv_q instead of isl_ast_op_fdiv_q
if we detect that the first argument is non-negative.
Now, we also check if the first argument is smaller than the second.
If so, we can rewrite
floor(e/d) = -ceil(-e/d) = -floor((-e + d - 1)/d)
and still use isl_ast_op_pdiv_q.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
14 files changed: