Re: [m-users.] Best way to implement constants ?

"Zoltan Somogyi" <[email protected]>
Newsgroups gmane.comp.lang.mercury.general
Message-ID <[email protected]>
On 2023-08-18 12:00 +02:00 CEST, "Julien Fischer" <[email protected]> wrote:
> When and why did that change? 

It happened in 2020 when I redesigned how we handled optimization
levels (to make manually specified optimization options sticky), which
involved moving the relevant code to the automatically generated
optimization_options.m. There was no "why"; this change was an accident,
which was not caught by review.

> I would argue that at least some of its work, notably string
> concatenation, ought to be done at -O2.

We can enable constant propagation at -O2, but there is no point
in doing so selectively. The main cost of that optimization
is the lookup of the predicate in const_prop.m's implicit database;
once you paid that cost, there is no point in accepting the optimization
of calls to some predicates/functions but rejecting the optimization of calls
to other predicates/functions.

Zoltan.
_______________________________________________
users mailing list
[email protected]
https://lists.mercurylang.org/listinfo/users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.