1
|
open Utils
|
2
|
open Lustre_types
|
3
|
open Machine_code_types
|
4
|
|
5
|
(* This functions produces an optimzed prog * machines It 1- eliminates common
|
6
|
sub-expressions (TODO how is this different from normalization?) 2- inline
|
7
|
constants and eliminate duplicated variables 3- try to reuse variables
|
8
|
whenever possible
|
9
|
|
10
|
When item (2) identified eliminated variables, the initial prog is modified,
|
11
|
its normalized recomputed, as well as its scheduling, before regenerating the
|
12
|
machines.
|
13
|
|
14
|
The function returns both the (possibly updated) prog as well as the machines *)
|
15
|
val optimize: Normalization.param_t -> program_t -> Scheduling_type.schedule_report IMap.t ->
|
16
|
machine_t list -> program_t * machine_t list
|