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

Zoltan Somogyi zoltan.somogyi at runbox.com
Fri Aug 18 21:02:40 AEST 2023


On 2023-08-18 12:00 +02:00 CEST, "Julien Fischer" <jfischer at opturion.com> 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.


More information about the users mailing list