Skip to content

Commit

Permalink
Remove the -force-tmc flag (#11661)
Browse files Browse the repository at this point in the history
-force-tmc was initially implemented by Frédéric Bour as a way to
implement "automatic TMC optimization" on top of the default behavior
which is "opt-in TMC optimization". We later decided to disable it,
because its usage was in tension with the goals we were setting for
the opt-in mode (in particular: have proper warnings and errors when
something that could be unexpected is going on).

It was kept for debugging purposes, and apparently found a way to
skean in the final merge for TMC (very probably my mistake), but in
a state where it is actually a no-op.

(cherry picked from commit a7fbbfa48edc3d7ba2b839dc76d93b53ff4ca7f3)
  • Loading branch information
gasche authored and xavierleroy committed Oct 27, 2022
1 parent bd87a61 commit fb5b1e4
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 15 deletions.
12 changes: 0 additions & 12 deletions driver/main_args.ml
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,6 @@ let mk_no_unboxed_types f =
" unannotated unboxable types will not be unboxed (default)"
;;

let mk_force_tmc f =
"-force-tmc", Arg.Unit f, " Rewrite all possible TMC calls"
;;

let mk_unsafe f =
"-unsafe", Arg.Unit f,
" Do not compile bounds checking on array and string access"
Expand Down Expand Up @@ -935,7 +931,6 @@ module type Common_options = sig
val _no_strict_sequence : unit -> unit
val _strict_formats : unit -> unit
val _no_strict_formats : unit -> unit
val _force_tmc : unit -> unit
val _unboxed_types : unit -> unit
val _no_unboxed_types : unit -> unit
val _unsafe_string : unit -> unit
Expand Down Expand Up @@ -1232,7 +1227,6 @@ struct
mk_strict_formats F._strict_formats;
mk_no_strict_formats F._no_strict_formats;
mk_thread F._thread;
mk_force_tmc F._force_tmc;
mk_unboxed_types F._unboxed_types;
mk_no_unboxed_types F._no_unboxed_types;
mk_unsafe F._unsafe;
Expand Down Expand Up @@ -1435,7 +1429,6 @@ struct
mk_strict_formats F._strict_formats;
mk_no_strict_formats F._no_strict_formats;
mk_thread F._thread;
mk_force_tmc F._force_tmc;
mk_unbox_closures F._unbox_closures;
mk_unbox_closures_factor F._unbox_closures_factor;
mk_inline_max_unroll F._inline_max_unroll;
Expand Down Expand Up @@ -1635,7 +1628,6 @@ struct
mk_strict_formats F._strict_formats;
mk_no_strict_formats F._no_strict_formats;
mk_thread F._thread;
mk_force_tmc F._force_tmc;
mk_unboxed_types F._unboxed_types;
mk_no_unboxed_types F._no_unboxed_types;
mk_unsafe_string F._unsafe_string;
Expand Down Expand Up @@ -1939,7 +1931,6 @@ module Default = struct
let _noprompt = set noprompt
let _nopromptcont = set nopromptcont
let _stdin () = (* placeholder: file_argument ""*) ()
let _force_tmc = set force_tmc
let _version () = print_version ()
let _vnum () = print_version_num ()
let _eval (_:string) = ()
Expand Down Expand Up @@ -1976,7 +1967,6 @@ module Default = struct
"Profiling with \"gprof\" (option `-p') is only supported up to \
OCaml 4.08.0"
let _shared () = shared := true; dlcode := true
let _force_tmc = set force_tmc
let _v () = Compenv.print_version_and_library "native-code compiler"
end

Expand All @@ -1997,7 +1987,6 @@ module Default = struct
let _pp s = Clflags.preprocessor := (Some s)
let _ppx s = Clflags.all_ppx := (s :: (!Clflags.all_ppx))
let _thread = set Clflags.use_threads
let _force_tmc = set force_tmc
let _v () = Compenv.print_version_and_library "documentation generator"
let _verbose = set Clflags.verbose
let _version = Compenv.print_version_string
Expand Down Expand Up @@ -2031,7 +2020,6 @@ third-party libraries such as Lwt, but with a different API."
let _output_complete_exe () =
_output_complete_obj (); output_complete_executable := true
let _output_obj () = output_c_object := true; custom_runtime := true
let _force_tmc = set force_tmc
let _use_prims s = use_prims := s
let _use_runtime s = use_runtime := s
let _v () = Compenv.print_version_and_library "compiler"
Expand Down
1 change: 0 additions & 1 deletion driver/main_args.mli
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ module type Common_options = sig
val _no_strict_sequence : unit -> unit
val _strict_formats : unit -> unit
val _no_strict_formats : unit -> unit
val _force_tmc : unit -> unit
val _unboxed_types : unit -> unit
val _no_unboxed_types : unit -> unit
val _unsafe_string : unit -> unit
Expand Down
1 change: 0 additions & 1 deletion utils/clflags.ml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ let profile_columns : Profile.column list ref = ref [] (* -dprofile/-dtimings *)

let native_code = ref false (* set to true under ocamlopt *)

let force_tmc = ref false (* -force-tmc *)
let force_slash = ref false (* for ocamldep *)
let clambda_checks = ref false (* -clambda-checks *)
let cmm_invariants =
Expand Down
1 change: 0 additions & 1 deletion utils/clflags.mli
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ val dlcode : bool ref
val pic_code : bool ref
val runtime_variant : string ref
val with_runtime : bool ref
val force_tmc : bool ref
val force_slash : bool ref
val keep_docs : bool ref
val keep_locs : bool ref
Expand Down

0 comments on commit fb5b1e4

Please sign in to comment.