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

Zoltan Somogyi zoltan.somogyi at runbox.com
Tue Oct 23 18:27:37 AEDT 2018



On Tue, 23 Oct 2018 16:43:29 +1100, Peter Wang <novalazy at gmail.com> wrote:
> compiler/simplify_goal_call.m:
>     Replace calls to comparison predicates < > =< >= of int types in
>     which both arguments are the same variable with 'true' or 'false'
>     goals.
> 
>     Replace calls to builtin.compare/3 where the compared arguments are
>     the same variable with a goal that assigns (=) as the comparison
>     result.
> 
>     Factor out common simplifications to all int types.

I  see how this diff factors them out for all *sized* int/uint types;
I don't see how it factors them out for int and uint.
Then again, that may be because the diff is hard to read,
because the diff algorithm got confused and accidentally
resynchronized on matched lines that happen to be irrelevant.

In any case, since I assume this diff passes bootcheck,
I think you should commit it, and I will have a proper look
this evening.

Zoltan.


More information about the reviews mailing list