diff options
author | Mark Shinwell <mshinwell@gmail.com> | 2016-02-08 14:05:38 +0100 |
---|---|---|
committer | Mark Shinwell <mshinwell@gmail.com> | 2016-02-09 09:59:26 +0100 |
commit | a3975110317da9b47b018f60fdb57236e8db9f12 (patch) | |
tree | 55b067c9c19f128a35fc6d5a89228255855ae646 /driver | |
parent | ec190a03a3e33acee42aea7f27a931ff70d3216f (diff) | |
download | ocaml-a3975110317da9b47b018f60fdb57236e8db9f12.tar.gz |
Import latest Flambda changes
Diffstat (limited to 'driver')
-rw-r--r-- | driver/compenv.ml | 2 | ||||
-rw-r--r-- | driver/main_args.ml | 28 | ||||
-rw-r--r-- | driver/main_args.mli | 3 | ||||
-rw-r--r-- | driver/optcompile.ml | 4 | ||||
-rw-r--r-- | driver/optmain.ml | 3 |
5 files changed, 25 insertions, 15 deletions
diff --git a/driver/compenv.ml b/driver/compenv.ml index f8933dcdba..12554166c7 100644 --- a/driver/compenv.ml +++ b/driver/compenv.ml @@ -279,8 +279,6 @@ let read_one_param ppf position name v = set "unbox-closures" [ unbox_closures ] v | "remove-unused-arguments" -> set "remove-unused-arguments" [ remove_unused_arguments ] v - | "no-inline-recursive-functions" -> - clear "no-inline-recursive-functions" [ inline_recursive_functions ] v | "inlining-report" -> if !native_code then diff --git a/driver/main_args.ml b/driver/main_args.ml index df4ded0ecd..658337bf06 100644 --- a/driver/main_args.ml +++ b/driver/main_args.ml @@ -291,11 +291,6 @@ let mk_noinit f = "-noinit", Arg.Unit f, " Do not load any init file" -let mk_no_inline_recursive_functions f = - "-no-inline-recursive-functions", Arg.Unit f, - " Do not duplicate and specialise declarations of recursive functions" -;; - let mk_nolabels f = "-nolabels", Arg.Unit f, " Ignore non-optional labels in types" ;; @@ -314,6 +309,16 @@ let mk_nostdlib f = " Do not add default directory to the list of include directories" ;; +let mk_no_unbox_free_vars_of_closures f = + "-no-unbox-free-vars-of-closures", Arg.Unit f, + " Do not unbox variables that will appear inside function closures" +;; + +let mk_no_unbox_specialised_args f = + "-no-unbox-specialised-args", Arg.Unit f, + " Do not unbox arguments to which functions have been specialised" +;; + let mk_o f = "-o", Arg.String f, "<file> Set output file name to <file>" ;; @@ -363,7 +368,7 @@ let mk_rectypes f = let mk_remove_unused_arguments f = "-remove-unused-arguments", Arg.Unit f, - " Remove unused function arguments (experimental)" + " Remove unused function arguments" ;; let mk_runtime_variant f = @@ -407,7 +412,7 @@ let mk_dtimings f = let mk_unbox_closures f = "-unbox-closures", Arg.Unit f, - " Unbox closures into function arguments (experimental)" + " Pass free variables via specialised arguments rather than closures" ;; let mk_unsafe f = @@ -751,8 +756,9 @@ module type Optcommon_options = sig val _inline_lifting_benefit : string -> unit val _unbox_closures : unit -> unit val _branch_inline_factor : string -> unit - val _no_inline_recursive_functions : unit -> unit val _remove_unused_arguments : unit -> unit + val _no_unbox_free_vars_of_closures : unit -> unit + val _no_unbox_specialised_args : unit -> unit val _o2 : unit -> unit val _o3 : unit -> unit @@ -994,9 +1000,10 @@ struct mk_noassert F._noassert; mk_noautolink_opt F._noautolink; mk_nodynlink F._nodynlink; - mk_no_inline_recursive_functions F._no_inline_recursive_functions; mk_nolabels F._nolabels; mk_nostdlib F._nostdlib; + mk_no_unbox_free_vars_of_closures F._no_unbox_free_vars_of_closures; + mk_no_unbox_specialised_args F._no_unbox_specialised_args; mk_o F._o; mk_o2 F._o2; mk_o3 F._o3; @@ -1090,11 +1097,12 @@ module Make_opttop_options (F : Opttop_options) = struct mk_no_app_funct F._no_app_funct; mk_noassert F._noassert; mk_noinit F._noinit; - mk_no_inline_recursive_functions F._no_inline_recursive_functions; mk_nolabels F._nolabels; mk_noprompt F._noprompt; mk_nopromptcont F._nopromptcont; mk_nostdlib F._nostdlib; + mk_no_unbox_free_vars_of_closures F._no_unbox_free_vars_of_closures; + mk_no_unbox_specialised_args F._no_unbox_specialised_args; mk_o2 F._o2; mk_o3 F._o3; mk_open F._open; diff --git a/driver/main_args.mli b/driver/main_args.mli index f45662e32a..aec9a4b9fc 100644 --- a/driver/main_args.mli +++ b/driver/main_args.mli @@ -133,8 +133,9 @@ module type Optcommon_options = sig val _inline_lifting_benefit : string -> unit val _unbox_closures : unit -> unit val _branch_inline_factor : string -> unit - val _no_inline_recursive_functions : unit -> unit val _remove_unused_arguments : unit -> unit + val _no_unbox_free_vars_of_closures : unit -> unit + val _no_unbox_specialised_args : unit -> unit val _o2 : unit -> unit val _o3 : unit -> unit diff --git a/driver/optcompile.ml b/driver/optcompile.ml index 9592de1a17..a0a82edb1e 100644 --- a/driver/optcompile.ml +++ b/driver/optcompile.ml @@ -91,7 +91,9 @@ let implementation ppf sourcefile outputprefix ~backend = Clflags.use_inlining_arguments_set ~round:1 Clflags.o2_arguments end else if !Clflags.classic_inlining then begin - Clflags.use_inlining_arguments_set Clflags.classic_arguments + Clflags.use_inlining_arguments_set Clflags.classic_arguments; + Clflags.unbox_free_vars_of_closures := false; + Clflags.unbox_specialised_args := false end; (typedtree, coercion) ++ Timings.(time (Timings.Transl sourcefile) diff --git a/driver/optmain.ml b/driver/optmain.ml index 22f09ca81b..1ce42c9e77 100644 --- a/driver/optmain.ml +++ b/driver/optmain.ml @@ -154,9 +154,10 @@ module Options = Main_args.Make_optcomp_options (struct let _noassert = set noassert let _noautolink = set no_auto_link let _nodynlink = clear dlcode - let _no_inline_recursive_functions = clear inline_recursive_functions let _nolabels = set classic let _nostdlib = set no_std_include + let _no_unbox_free_vars_of_closures = clear unbox_free_vars_of_closures + let _no_unbox_specialised_args = clear unbox_specialised_args let _o s = output_name := Some s (* CR mshinwell: should stop e.g. -O2 -classic-inlining lgesbert: could be done in main() below, like for -pack and -c, but that |