diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2019-01-18 15:22:03 +0100 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2019-01-18 15:22:03 +0100 |
commit | 458df74c1280ab4f6131272b20f8613cbd683f87 (patch) | |
tree | ac66a66a77bbe1c8c62b4f209c0b5965b2b0625e | |
parent | 5122c5f507dcb3cfe5ed6f1df7e52a1e948a03b4 (diff) | |
download | compcert-kvx-458df74c1280ab4f6131272b20f8613cbd683f87.tar.gz compcert-kvx-458df74c1280ab4f6131272b20f8613cbd683f87.zip |
-O0 will not perform postpass scheduling
-rw-r--r-- | driver/Clflags.ml | 1 | ||||
-rw-r--r-- | driver/Compopts.v | 3 | ||||
-rw-r--r-- | driver/Driver.ml | 4 | ||||
-rw-r--r-- | extraction/extraction.v | 5 | ||||
-rw-r--r-- | mppa_k1c/PostpassSchedulingOracle.ml | 2 |
5 files changed, 12 insertions, 3 deletions
diff --git a/driver/Clflags.ml b/driver/Clflags.ml index a886ee9b..99ee41e7 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -27,6 +27,7 @@ let option_ftailcalls = ref true let option_fconstprop = ref true let option_fcse = ref true let option_fredundancy = ref true +let option_fpostpass = ref true let option_falignfunctions = ref (None: int option) let option_falignbranchtargets = ref 0 let option_faligncondbranchs = ref 0 diff --git a/driver/Compopts.v b/driver/Compopts.v index 2a213350..e6eecc9b 100644 --- a/driver/Compopts.v +++ b/driver/Compopts.v @@ -39,6 +39,9 @@ Parameter optim_CSE: unit -> bool. (** Flag -fredundancy. For dead code elimination. *) Parameter optim_redundancy: unit -> bool. +(** Flag -fpostpass. Postpass scheduling for K1 architecture *) +Parameter optim_postpass: unit -> bool. + (** Flag -fthumb. For the ARM back-end. *) Parameter thumb: unit -> bool. diff --git a/driver/Driver.ml b/driver/Driver.ml index 8ab8557c..467cf989 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -193,6 +193,7 @@ Processing options: (<n>=0: none, <n>=1: limited, <n>=2: full; default is full) -fcse Perform common subexpression elimination [on] -fredundancy Perform redundancy elimination [on] + -fpostpass Perform postpass scheduling (only for K1 architecture) [on] -finline Perform inlining of functions [on] -finline-functions-called-once Integrate functions only required by their single caller [on] @@ -249,7 +250,7 @@ let dump_mnemonics destfile = exit 0 let optimization_options = [ - option_ftailcalls; option_fconstprop; option_fcse; option_fredundancy; option_finline_functions_called_once; + option_ftailcalls; option_fconstprop; option_fcse; option_fredundancy; option_fpostpass; option_finline_functions_called_once; ] let set_all opts () = List.iter (fun r -> r := true) opts @@ -361,6 +362,7 @@ let cmdline_actions = @ f_opt "const-prop" option_fconstprop @ f_opt "cse" option_fcse @ f_opt "redundancy" option_fredundancy + @ f_opt "postpass" option_fpostpass @ f_opt "inline" option_finline @ f_opt "inline-functions-called-once" option_finline_functions_called_once (* Code generation options *) diff --git a/extraction/extraction.v b/extraction/extraction.v index f18c1274..f58991aa 100644 --- a/extraction/extraction.v +++ b/extraction/extraction.v @@ -111,6 +111,8 @@ Extract Constant Compopts.optim_CSE => "fun _ -> !Clflags.option_fcse". Extract Constant Compopts.optim_redundancy => "fun _ -> !Clflags.option_fredundancy". +Extract Constant Compopts.optim_postpass => + "fun _ -> !Clflags.option_fpostpass". Extract Constant Compopts.thumb => "fun _ -> !Clflags.option_mthumb". Extract Constant Compopts.debug => @@ -188,4 +190,5 @@ Separate Extraction AST.signature_main Asmaux Floats.Float32.from_parsed Floats.Float.from_parsed Globalenvs.Senv.invert_symbol - Parser.translation_unit_file. + Parser.translation_unit_file + Compopts.optim_postpass. diff --git a/mppa_k1c/PostpassSchedulingOracle.ml b/mppa_k1c/PostpassSchedulingOracle.ml index a3851373..083decde 100644 --- a/mppa_k1c/PostpassSchedulingOracle.ml +++ b/mppa_k1c/PostpassSchedulingOracle.ml @@ -675,4 +675,4 @@ let smart_schedule bb = let schedule bb = if debug then (eprintf "###############################\n"; Printf.eprintf "SCHEDULING\n"; print_bb stderr bb); (* print_problem (build_problem bb); *) - smart_schedule bb + if Compopts.optim_postpass () then smart_schedule bb else dumb_schedule bb |