aboutsummaryrefslogtreecommitdiffstats
path: root/driver/Driver.ml
diff options
context:
space:
mode:
Diffstat (limited to 'driver/Driver.ml')
-rw-r--r--driver/Driver.ml30
1 files changed, 29 insertions, 1 deletions
diff --git a/driver/Driver.ml b/driver/Driver.ml
index bdf72250..db71aef9 100644
--- a/driver/Driver.ml
+++ b/driver/Driver.ml
@@ -185,7 +185,8 @@ Processing options:
{|Optimization options: (use -fno-<opt> to turn off -f<opt>)
-O Optimize the compiled code [on by default]
-O0 Do not optimize the compiled code
- -O1 -O2 -O3 Synonymous for -O
+ -O1 Perform all optimization passes except scheduling
+ -O2 -O3 Synonymous for -O
-Os Optimize for code size in preference to code speed
-Obranchless Optimize to generate fewer conditional branches; try to produce
branch-free instruction sequences as much as possible
@@ -196,6 +197,15 @@ Processing options:
-fcse Perform common subexpression elimination [on]
-fcse2 Perform inter-loop common subexpression elimination [on]
-fredundancy Perform redundancy elimination [on]
+ -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 Perform tail duplication to form superblocks on predicted traces
+ -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 recommended to also activate -fduplicate with this pass [off]
+ -fforward-moves Forward moves after CSE
-finline Perform inlining of functions [on]
-finline-functions-called-once Integrate functions only required by their
single caller [on]
@@ -256,6 +266,7 @@ let dump_mnemonics destfile =
let optimization_options = [
option_ftailcalls; option_fifconversion; option_fconstprop;
option_fcse; option_fcse2;
+ option_fpostpass;
option_fredundancy; option_finline; option_finline_functions_called_once;
]
@@ -269,6 +280,10 @@ let num_input_files = ref 0
let cmdline_actions =
let f_opt name ref =
[Exact("-f" ^ name), Set ref; Exact("-fno-" ^ name), Unset ref] in
+ let f_opt_str name ref strref =
+ [Exact("-f" ^ name ^ "="), String
+ (fun s -> (strref := (if s == "" then "list" else s)); ref := true)
+ ] in
let check_align n =
if n <= 0 || ((n land (n - 1)) <> 0) then
error no_loc "requested alignment %d is not a power of 2" n
@@ -303,6 +318,7 @@ let cmdline_actions =
[
Exact "-O0", Unit (unset_all optimization_options);
Exact "-O", Unit (set_all optimization_options);
+ _Regexp "-O1", Self (fun _ -> set_all optimization_options (); option_fpostpass := false; option_fduplicate := false);
_Regexp "-O[123]$", Unit (set_all optimization_options);
Exact "-Os", Set option_Osize;
Exact "-Obranchless", Set option_Obranchless;
@@ -376,8 +392,20 @@ let cmdline_actions =
@ f_opt "cse" option_fcse
@ f_opt "cse2" option_fcse2
@ f_opt "redundancy" option_fredundancy
+ @ f_opt "postpass" option_fpostpass
+ @ f_opt "duplicate" option_fduplicate
+ @ f_opt "invertcond" option_finvertcond
+ @ f_opt "tracelinearize" option_ftracelinearize
+ @ f_opt_str "postpass" option_fpostpass option_fpostpass_sched
@ f_opt "inline" option_finline
@ f_opt "inline-functions-called-once" option_finline_functions_called_once
+ @ f_opt "globaladdrtmp" option_fglobaladdrtmp
+ @ f_opt "globaladdroffset" option_fglobaladdroffset
+ @ f_opt "xsaddr" option_fxsaddr
+ @ f_opt "addx" option_faddx
+ @ f_opt "coalesce-mem" option_fcoalesce_mem
+ @ f_opt "all-loads-nontrap" option_all_loads_nontrap
+ @ f_opt "forward-moves" option_fforward_moves
(* Code generation options *)
@ f_opt "fpu" option_ffpu
@ f_opt "sse" option_ffpu (* backward compatibility *)