[m-rev.] for review: Simplify away self-comparisons of int types in pregen grades.

Zoltan Somogyi zoltan.somogyi at runbox.com
Tue Oct 23 18:32:03 AEDT 2018



On Tue, 23 Oct 2018 17:03:23 +1100, Peter Wang <novalazy at gmail.com> wrote:

> Previously we would simplify away self-comparisons of `int' and `uint'
> variables in .pregen grades; rectify that now.

Why would that need rectifying? I think you are missing a "not" somewhere.

> +simplify_improve_int_type_comparison_call(_ModuleName, PredName, _ModeNum,
> +        Args, ImprovedGoalExpr) :-
> +    (
>          ( PredName = "<"
>          ; PredName = ">"
>          ),
>          Args = [X, X],
>          ImprovedGoalExpr = fail_goal_expr
>      ;
>          ( PredName = "=<"
>          ; PredName = ">="
>          ),
>          Args = [X, X],
> -- 
> 2.19.1
> 
>

Where is the rest of it, i.e. ImprovedGoalExpr = true_goal_expr?

Other than that, the diff is fine.

Zoltan.


More information about the reviews mailing list