From 3009ec015ab7261323c9e318cb703eaabca07d47 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Fri, 9 Oct 2020 15:21:20 +0200 Subject: Changing duplicate verifier to be non optional --- driver/Compopts.v | 3 --- 1 file changed, 3 deletions(-) (limited to 'driver') diff --git a/driver/Compopts.v b/driver/Compopts.v index d576ede6..540e8922 100644 --- a/driver/Compopts.v +++ b/driver/Compopts.v @@ -27,9 +27,6 @@ Parameter generate_float_constants: unit -> bool. (** For value analysis. Currently always false. *) Parameter va_strict: unit -> bool. -(** Flag -fduplicate. Branch prediction annotation + tail duplication *) -Parameter optim_duplicate: unit -> bool. - (** Flag -ftailcalls. For tail call optimization. *) Parameter optim_tailcalls: unit -> bool. -- cgit From b22f1165b23be33da6cb7f6ac681c14abec37c23 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Fri, 9 Oct 2020 15:51:33 +0200 Subject: new flags: -fpredict, -ftailduplicate n, -funrollsingle n instead of just -fduplicate n --- driver/Clflags.ml | 10 +++++++--- driver/Driver.ml | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'driver') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index eb21b3f8..8bc7a938 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -33,9 +33,13 @@ let option_fcse3_across_calls = ref false let option_fcse3_across_merges = ref true let option_fcse3_glb = ref true let option_fredundancy = ref true -let option_fduplicate = ref (-1) -let option_finvertcond = ref true -let option_ftracelinearize = ref false + +(** Options relative to superblock scheduling *) +let option_fpredict = ref true (* insert static branch prediction information, and swaps ifso/ifnot branches accordingly *) +let option_ftailduplicate = ref 0 (* perform tail duplication for blocks of size n *) +let option_ftracelinearize = ref true (* uses branch prediction information to improve the linearization *) +let option_funrollsingle = ref 0 (* unroll a single iteration of innermost loops of size n *) + let option_fpostpass = ref true let option_fpostpass_sched = ref "list" let option_fifconversion = ref true diff --git a/driver/Driver.ml b/driver/Driver.ml index 90afb812..b0b1cdea 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -420,8 +420,9 @@ let cmdline_actions = @ f_opt "move-loop-invariants" option_fmove_loop_invariants @ f_opt "redundancy" option_fredundancy @ f_opt "postpass" option_fpostpass - @ [ Exact "-fduplicate", Integer (fun n -> option_fduplicate := n) ] - @ f_opt "invertcond" option_finvertcond + @ [ Exact "-ftailduplicate", Integer (fun n -> option_ftailduplicate := n) ] + @ f_opt "predict" option_fpredict + @ [ Exact "-funrollsingle", Integer (fun n -> option_funrollsingle := n) ] @ f_opt "tracelinearize" option_ftracelinearize @ f_opt_str "postpass" option_fpostpass option_fpostpass_sched @ f_opt "inline" option_finline -- cgit From b09b9a2e3f3f2612582bbf7ee624a48ad0e0b40f Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Wed, 14 Oct 2020 11:08:55 +0200 Subject: Updated --help --- driver/Driver.ml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'driver') diff --git a/driver/Driver.ml b/driver/Driver.ml index b0b1cdea..fae1524f 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -207,15 +207,11 @@ Processing options: -fpostpass Perform postpass scheduling (only for K1 architecture) [on] -fpostpass= Perform postpass scheduling with the specified optimization [list] (=list: list scheduling, =ilp: ILP, =greedy: just packing bundles) - -fduplicate Perform tail duplication to form superblocks on predicted traces - nb_nodes control the heuristic deciding to duplicate or not - A value of -1 desactivates the entire pass (including branch prediction) - A value of 0 desactivates the duplication (but activates the branch prediction) - FIXME : this is desactivated by default for now - -finvertcond Invert conditions based on predicted paths (to prefer fallthrough). - Requires -fduplicate to be also activated [on] - -ftracelinearize Linearizes based on the traces identified by duplicate phase - It is heavily recommended to activate -finvertcond with this pass [off] + -fpredict Insert static branch prediction information [on] + Also swaps ifso/ifnot branches accordingly at RTL level + -ftailduplicate n Perform tail duplication for RTL code blocks of size n (not counting Inops) [0] + -ftracelinearize Uses branch prediction information to improve the Linearize [on] + -funrollsingle n Unrolls a single iteration of innermost loops of size n (not counting Inops) [0] -fforward-moves Forward moves after CSE -finline Perform inlining of functions [on] -finline-functions-called-once Integrate functions only required by their -- cgit From 80760a9c21eb83c9807a569b0fb07216420cc721 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Wed, 14 Oct 2020 11:56:00 +0200 Subject: -O0 desactivates -fpredict and -ftracelinearize --- driver/Driver.ml | 1 + 1 file changed, 1 insertion(+) (limited to 'driver') diff --git a/driver/Driver.ml b/driver/Driver.ml index fae1524f..7ab80540 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -276,6 +276,7 @@ let dump_mnemonics destfile = let optimization_options = [ option_ftailcalls; option_fifconversion; option_fconstprop; option_fcse; option_fcse2; option_fcse3; + option_fpredict; option_ftracelinearize; option_fpostpass; option_fredundancy; option_finline; option_finline_functions_called_once; ] -- cgit From a2f31f2b886ccb9656a019db1780aabc1789368a Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Fri, 16 Oct 2020 14:38:06 +0200 Subject: Loop body unrolling with -funrollbody n --- driver/Clflags.ml | 1 + driver/Driver.ml | 2 ++ 2 files changed, 3 insertions(+) (limited to 'driver') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index 8bc7a938..9df58903 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -39,6 +39,7 @@ let option_fpredict = ref true (* insert static branch prediction information, a let option_ftailduplicate = ref 0 (* perform tail duplication for blocks of size n *) let option_ftracelinearize = ref true (* uses branch prediction information to improve the linearization *) let option_funrollsingle = ref 0 (* unroll a single iteration of innermost loops of size n *) +let option_funrollbody = ref 0 (* unroll the body of innermost loops of size n *) let option_fpostpass = ref true let option_fpostpass_sched = ref "list" diff --git a/driver/Driver.ml b/driver/Driver.ml index 7ab80540..12f50762 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -212,6 +212,7 @@ Processing options: -ftailduplicate n Perform tail duplication for RTL code blocks of size n (not counting Inops) [0] -ftracelinearize Uses branch prediction information to improve the Linearize [on] -funrollsingle n Unrolls a single iteration of innermost loops of size n (not counting Inops) [0] + -funrollbody n Unrolls once the body of innermost loops of size n (not counting Inops) [0] -fforward-moves Forward moves after CSE -finline Perform inlining of functions [on] -finline-functions-called-once Integrate functions only required by their @@ -420,6 +421,7 @@ let cmdline_actions = @ [ Exact "-ftailduplicate", Integer (fun n -> option_ftailduplicate := n) ] @ f_opt "predict" option_fpredict @ [ Exact "-funrollsingle", Integer (fun n -> option_funrollsingle := n) ] + @ [ Exact "-funrollbody", Integer (fun n -> option_funrollbody := n) ] @ f_opt "tracelinearize" option_ftracelinearize @ f_opt_str "postpass" option_fpostpass option_fpostpass_sched @ f_opt "inline" option_finline -- cgit