Ignore:
Timestamp:
Nov 23, 2011, 5:43:24 PM (9 years ago)
Author:
tranquil
Message:

merge of indexed labels branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/options.ml

    r1462 r1542  
    4848let is_debug_enabled ()         = !debug_flag
    4949
     50let transformations = ref []
     51let add_transformation t () = transformations := !transformations @ [t]
     52let add_transformations ts () = transformations := !transformations @ ts
     53let get_transformations () = !transformations
     54
     55let cost_ternary_flag           = ref true
     56let set_cost_ternary            = (:=) cost_ternary_flag
     57let is_cost_ternary_enabled ()  = !cost_ternary_flag
     58
    5059let asm_pretty_flag             = ref false
    5160let set_asm_pretty              = (:=) asm_pretty_flag
     
    7988let set_lustre_test_max_int     = (:=) lustre_test_max_int
    8089let get_lustre_test_max_int ()  = !lustre_test_max_int
     90
    8191
    8292(*
     
    8999let set_dev_test                = (:=) dev_test
    90100let is_dev_test_enabled ()      = !dev_test
     101
     102let help_specify_opt_stage (trans : Languages.transformation) =
     103        Printf.sprintf "(done at the %s stage)." (Languages.to_string (fst trans))
     104
     105let basic_optimizations =
     106  [
     107    LoopPeeling.trans;
     108    ConstPropagation.trans;
     109    CopyPropagation.trans;
     110    RedundancyElimination.trans;
     111    CopyPropagation.trans;
     112    RedundancyElimination.trans
     113  ]
     114 
    91115
    92116let options = OptionsParsing.register [
     
    148172  extra_doc " [default is 1000]";
    149173
     174  "-peel", Arg.Unit (add_transformation LoopPeeling.trans),
     175  " Apply loop peeling " ^
     176    help_specify_opt_stage LoopPeeling.trans;
     177
     178  "-cst-prop", Arg.Unit (add_transformation ConstPropagation.trans),
     179  " Apply constant propagation " ^
     180    help_specify_opt_stage ConstPropagation.trans;
     181
     182  "-cpy-prop", Arg.Unit (add_transformation CopyPropagation.trans),
     183  " Apply copy propagation " ^
     184    help_specify_opt_stage CopyPropagation.trans;
     185
     186  "-pre", Arg.Unit (add_transformation RedundancyElimination.trans),
     187  " Apply partial redundancy elimination " ^
     188    help_specify_opt_stage RedundancyElimination.trans;
     189
     190  "-unroll-for",
     191  Arg.Int (fun i -> add_transformation (LoopUnrolling.trans ~factor:i ()) ()),
     192  " Apply loop unrolling, specifying factor " ^
     193  help_specify_opt_stage (LoopUnrolling.trans ());
     194
     195  "-unroll", Arg.Unit (add_transformation (LoopUnrolling.trans ())),
     196  " Apply loop unrolling " ^
     197  help_specify_opt_stage (LoopUnrolling.trans ());
     198
     199  "-O", Arg.Unit (add_transformations basic_optimizations),
     200  " Apply some optimizations.";
     201
     202  "-no-cost-tern",  Arg.Clear cost_ternary_flag,
     203  " Replace cost ternary expressions with equivalent branch statements.";
     204 
    150205(*
    151206  "-res", Arg.Set print_result_flag,
Note: See TracChangeset for help on using the changeset viewer.