[m-rev.] for review: ml_unused_assign.m

Julien Fischer jfischer at opturion.com
Mon May 7 10:26:54 AEST 2018


Hi Zoltan,

On Sat, 5 May 2018, Zoltan Somogyi wrote:

> Delete assignments to dead variables in the MLDS.

...

> compiler/mlds.m:
>     The new optimization needs extra information about loops.
>     When it enters into the loop body, it knows which variables
>     are needed *after* the loop, but it does not know which variables
>     the loop body first reads and then writes. Without this knowledge,
>     it would optimize away assignments to loop control variables,
>     such as the increment of i in the loop
>
>     i = 0;
>     while (...) {
>         ...; i = i+1; ...
>     }
>
>     Traditionlly, compilers have solved this problem by doing fixpoint

s/Traditionally/Traditionally/

>     iteration, adding to the live set at each program point until
>     no more additions are possible. We can do better, because we generate
>     loops in the MLDS in only two kinds of cases:

The diff itself looks fine.  (I assume you intend to apply the upcoming
in optimization to field updates in LLDS grade as well BTW?)

Julien.


More information about the reviews mailing list