isl_map_simplify.c: eliminate_var_using_equality: reuse scale_down_inequality
commit94dc4fb80afb1d6368f2f83c79ede0620b6db9b1
authorSven Verdoolaege <sven@cerebras.net>
Fri, 19 Nov 2021 14:29:20 +0000 (19 15:29 +0100)
committerSven Verdoolaege <sven@cerebras.net>
Sat, 10 Feb 2024 15:03:39 +0000 (10 16:03 +0100)
tree6ca1355ccc5f40e015dc2f1e41ae193a826f8218
parentced45340b57da2bf2cbbcd605936198eb013a5c6
isl_map_simplify.c: eliminate_var_using_equality: reuse scale_down_inequality

This prepares for an upcoming commit where scale_down_inequality
will take into account the effect of the scaling on the constraints.

Note that unlike the call from isl_basic_map_normalize_constraints,
the call from eliminate_var_using_equality always passes
in the gcd of the entire constraint, including the constant term.
This means that the scaling will never tighten the constraint.

It would be possible to let both callers only pass in
the gcd of the variable coefficients and to let scale_down_inequality
include the constant term in case of a rational input.
However, this would be a change with respect to the current behavior and
should therefore be considered separately.
In fact, this has an effect on some of the AST generation outputs and
it is not immediately obvious if those changes are desirable.

Signed-off-by: Sven Verdoolaege <sven@cerebras.net>
isl_map_simplify.c