Project

General

Profile

« Previous | Next » 

Revision d0b1ec56

Added by Xavier Thirioux over 10 years ago

- changed the basic optimization scheme (option -O 2), which unfolds
local variables and global variables that are either cheap to evaluate
or used no more than once.

git-svn-id: https://cavale.enseeiht.fr/svn/lustrec/lustre_compiler/trunk@339 041b043f-8d7c-46b2-b46e-ef0dd855326e

View differences:

src/main_lustre_compiler.ml
202 202
    - eliminate trivial expressions
203 203
 *)
204 204
  let prog = 
205
    if !Options.optimization >= 2 then 
205
    if !Options.optimization >= 4 then 
206 206
      Optimize_prog.prog_unfold_consts prog 
207 207
    else
208 208
      prog
......
214 214

  
215 215
  (* Optimize machine code *)
216 216
  let machine_code = 
217
    if !Options.optimization >= 3 && !Options.output <> "horn" then
217
    if !Options.optimization >= 2 && !Options.output <> "horn" then
218 218
      begin
219
	Log.report ~level:1 (fun fmt -> fprintf fmt ".. machines optimization@,");
220
	Optimize_machine.machines_reuse_variables machine_code node_schs
219
	Log.report ~level:1 (fun fmt -> fprintf fmt ".. machines optimization (phase 1)@,");
220
	Optimize_machine.machines_unfold (Corelang.get_consts prog) node_schs machine_code
221 221
      end
222 222
    else
223 223
      machine_code
224 224
 in  
225
  (* Optimize machine code *)
225 226
  let machine_code = 
226 227
    if !Options.optimization >= 3 && !Options.output <> "horn" then
227 228
      begin
228
	Optimize_machine.machines_fusion machine_code
229
	Log.report ~level:1 (fun fmt -> fprintf fmt ".. machines optimization (phase 2)@,");
230
	Optimize_machine.machines_fusion (Optimize_machine.machines_reuse_variables machine_code node_schs)
229 231
      end
230 232
    else
231 233
      machine_code

Also available in: Unified diff