[m-rev.] for review: fix mantis bug 496 as far as possible

Julien Fischer jfischer at opturion.com
Fri Feb 7 09:49:44 AEDT 2020



On Thu, 6 Feb 2020, Zoltan Somogyi wrote:

> Emit a reminder about a limitation of cse_detection when needed.
> 
> Common subexpression elimination (cse) decline to do its job of transforming

s/decline/declines/

>
>     (
>         X = f(A1, ..., An),
>         goal A
>     ;
>         X = f(B1, ..., Bn),
>         goal B
>     )
> 
> into
>
>     X = f(X1, ..., Xn),
>     (
>         A1 = X1, ..., An = Xn,
>         goal A
>     ;
>         B1 = X1, ..., Bn = Xn,
>         goal B
>     )
> 
> when the insts of some of X's arguments are at least partially unique,
> because mode analysis cannot track uniqueness through the extra unifications
> that this transformation introduces. When this happens, and the procedure
> this code is in does not match its declared determinism, generate a message
> that gives this fact as the possible reason for that determinism mismatch.
> 
> This fixes Mantis bug #496 to the extent that we *can* fix it
> without rewriting the whole of mode analysis.

That looks fine -- thanks for looking at it.

One other issue is that I think the illustration we give in the NEWS file
for this issue is misleading; it looks as though the problem involves
field selection, when it is in fact more general.

I'll adapt the above explanation for the 20.01.1 NEWS when I merge this
change on to the release branch.

Julien.


More information about the reviews mailing list