diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-10-18 22:49:10 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-10-18 22:49:10 +0200 |
commit | 996a2e5bbc4826d95144b62f5218b6e3e1e7d881 (patch) | |
tree | 55a5136c68e7d0f7a304913f28d0a761d9facd9a /driver | |
parent | 8c3a2bdb56eba8d8bc5e359b01a320916eac85f0 (diff) | |
parent | a2f31f2b886ccb9656a019db1780aabc1789368a (diff) | |
download | compcert-kvx-996a2e5bbc4826d95144b62f5218b6e3e1e7d881.tar.gz compcert-kvx-996a2e5bbc4826d95144b62f5218b6e3e1e7d881.zip |
Merge remote-tracking branch 'origin/kvx-work' into kvx-test-prepass
Diffstat (limited to 'driver')
-rw-r--r-- | driver/Clflags.ml | 14 | ||||
-rw-r--r-- | driver/Compopts.v | 3 | ||||
-rw-r--r-- | driver/Driver.ml | 22 |
3 files changed, 22 insertions, 17 deletions
diff --git a/driver/Clflags.ml b/driver/Clflags.ml index 829af76a..d5f3aca5 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -33,13 +33,21 @@ 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_funrollbody = ref 0 (* unroll the body of innermost loops of size n *) + +(* Scheduling *) let option_fprepass = ref false let option_fprepass_sched = ref "list" + let option_fpostpass = ref true let option_fpostpass_sched = ref "list" + let option_fifconversion = ref true let option_Obranchless = ref false let option_falignfunctions = ref (None: int option) 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. diff --git a/driver/Driver.ml b/driver/Driver.ml index fef9c166..e5fc78f8 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -210,15 +210,12 @@ Processing options: -fpostpass Perform postpass scheduling (only for K1 architecture) [on] -fpostpass= <optim> Perform postpass scheduling with the specified optimization [list] (<optim>=list: list scheduling, <optim>=ilp: ILP, <optim>=greedy: just packing bundles) - -fduplicate <nb_nodes> 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] + -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 @@ -283,6 +280,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; ] @@ -424,8 +422,10 @@ let cmdline_actions = @ f_opt "redundancy" option_fredundancy @ f_opt "prepass" option_fprepass @ 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) ] + @ [ Exact "-funrollbody", Integer (fun n -> option_funrollbody := n) ] @ f_opt "tracelinearize" option_ftracelinearize @ f_opt_str "prepass" option_fprepass option_fprepass_sched @ f_opt_str "postpass" option_fpostpass option_fpostpass_sched |