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

Julien Fischer jfischer at opturion.com
Fri Aug 18 21:10:59 AEST 2023


On Fri, 18 Aug 2023, Zoltan Somogyi wrote:

> 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 figured it was something like that.

>> 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.

In which case, I suggest we enable const prop at -O2.
This means that it is done by default (usually).

Julien.


More information about the users mailing list