From db732621a17a498b518d966489a738fd7945437c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Wed, 15 Sep 2010 09:53:20 +0200 Subject: [PATCH] Re enabled iterator fusion Added an option to enable it (off by default) --- compiler/main/heptc.ml | 1 + compiler/minils/main/mls_compiler.ml | 2 +- compiler/minils/main/mlsc.ml | 1 + compiler/utilities/global/compiler_options.ml | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/main/heptc.ml b/compiler/main/heptc.ml index e821550..5830f4a 100644 --- a/compiler/main/heptc.ml +++ b/compiler/main/heptc.ml @@ -85,6 +85,7 @@ let main () = "-targetpath", Arg.String set_target_path, doc_target_path; "-noinit", Arg.Clear init, doc_noinit; "-fti", Arg.Set full_type_info, doc_full_type_info; + "-itfusion", Arg.Set do_iterator_fusion, doc_itfusion; ] (compile compile_impl) errmsg; diff --git a/compiler/minils/main/mls_compiler.ml b/compiler/minils/main/mls_compiler.ml index fe191d4..ce8d45f 100644 --- a/compiler/minils/main/mls_compiler.ml +++ b/compiler/minils/main/mls_compiler.ml @@ -37,7 +37,7 @@ let compile pp p = (*let p = silent_pass "Initialization check" !init Init.program p in *) (* Iterator fusion *) - (*let p = pass "Iterator fusion" false Itfusion.program p pp in*) + let p = pass "Iterator fusion" !do_iterator_fusion Itfusion.program p pp in (* Normalization to maximize opportunities *) let p = pass "Normalization" true Normalize.program p pp in diff --git a/compiler/minils/main/mlsc.ml b/compiler/minils/main/mlsc.ml index f7793c9..7884f95 100644 --- a/compiler/minils/main/mlsc.ml +++ b/compiler/minils/main/mlsc.ml @@ -79,6 +79,7 @@ let main () = "-targetpath", Arg.String set_target_path, doc_target_path; "-noinit", Arg.Clear init, doc_noinit; "-fti", Arg.Set full_type_info, doc_full_type_info; + "-itfusion", Arg.Set do_iterator_fusion, doc_itfusion; ] compile errmsg; diff --git a/compiler/utilities/global/compiler_options.ml b/compiler/utilities/global/compiler_options.ml index e2dbcc2..b859741 100644 --- a/compiler/utilities/global/compiler_options.ml +++ b/compiler/utilities/global/compiler_options.ml @@ -82,6 +82,7 @@ let flatten = ref false let nodes_to_inline : string list ref = ref [] +let do_iterator_fusion = ref false let doc_verbose = "\t\t\tSet verbose mode" and doc_version = "\t\tThe version of the compiler" @@ -103,3 +104,4 @@ and doc_target_path = and doc_noinit = "\t\tDisable initialization analysis" and doc_assert = "\t\tInsert run-time assertions for boolean node " and doc_inline = "\t\tInline node " +and doc_itfusion = "\t\tEnable iterator fusion."