forked from ocaml-flambda/flambda-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflambda_backend_args.mli
167 lines (147 loc) · 7.02 KB
/
flambda_backend_args.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
(**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* Pierre Chambart, OCamlPro *)
(* Mark Shinwell and Leo White, Jane Street Europe *)
(* *)
(* Copyright 2013--2021 OCamlPro SAS *)
(* Copyright 2014--2021 Jane Street Group LLC *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)
(** This module follows the structure of ocaml/driver/main_args.ml{i}.
It provides a way to (a) share argument implementations between
different installable tools and (b) override default implementations
of arguments. *)
(** Command line arguments required for flambda backend. *)
module type Flambda_backend_options = sig
val ocamlcfg : unit -> unit
val no_ocamlcfg : unit -> unit
val dump_inlining_paths : unit -> unit
val davail : unit -> unit
val dranges : unit -> unit
val ddebug_invariants : unit -> unit
val dcfg : unit -> unit
val dcfg_invariants : unit -> unit
val dcfg_equivalence_check : unit -> unit
val regalloc : string -> unit
val regalloc_param : string -> unit
val regalloc_validate : unit -> unit
val no_regalloc_validate : unit -> unit
val cfg_peephole_optimize : unit -> unit
val no_cfg_peephole_optimize : unit -> unit
val reorder_blocks_random : int -> unit
val basic_block_sections : unit -> unit
val dasm_comments : unit -> unit
val dno_asm_comments : unit -> unit
val heap_reduction_threshold : int -> unit
val zero_alloc_check : unit -> unit
val dcheckmach : unit -> unit
val checkmach_details_cutoff : int -> unit
val disable_poll_insertion : unit -> unit
val enable_poll_insertion : unit -> unit
val long_frames : unit -> unit
val no_long_frames : unit -> unit
val long_frames_threshold : int -> unit
val caml_apply_inline_fast_path : unit -> unit
val internal_assembler : unit -> unit
val gc_timings : unit -> unit
val flambda2_debug : unit -> unit
val no_flambda2_debug : unit -> unit
val flambda2_join_points : unit -> unit
val no_flambda2_join_points : unit -> unit
val flambda2_result_types_functors_only : unit -> unit
val flambda2_result_types_all_functions : unit -> unit
val no_flambda2_result_types : unit -> unit
val flambda2_unbox_along_intra_function_control_flow : unit -> unit
val no_flambda2_unbox_along_intra_function_control_flow : unit -> unit
val flambda2_backend_cse_at_toplevel : unit -> unit
val no_flambda2_backend_cse_at_toplevel : unit -> unit
val flambda2_cse_depth : int -> unit
val flambda2_join_depth : int -> unit
val flambda2_expert_fallback_inlining_heuristic : unit -> unit
val no_flambda2_expert_fallback_inlining_heuristic : unit -> unit
val flambda2_expert_inline_effects_in_cmm : unit -> unit
val no_flambda2_expert_inline_effects_in_cmm : unit -> unit
val flambda2_expert_phantom_lets : unit -> unit
val no_flambda2_expert_phantom_lets : unit -> unit
val flambda2_expert_max_block_size_for_projections : int -> unit
val flambda2_expert_max_unboxing_depth : int -> unit
val flambda2_expert_can_inline_recursive_functions : unit -> unit
val no_flambda2_expert_can_inline_recursive_functions : unit -> unit
val flambda2_expert_max_function_simplify_run : int -> unit
val flambda2_debug_concrete_types_only_on_canonicals : unit -> unit
val no_flambda2_debug_concrete_types_only_on_canonicals : unit -> unit
val flambda2_debug_keep_invalid_handlers : unit -> unit
val no_flambda2_debug_keep_invalid_handlers : unit -> unit
val flambda2_inline_max_depth : string -> unit
val flambda2_inline_max_rec_depth : string -> unit
val flambda2_inline_call_cost : string -> unit
val flambda2_inline_alloc_cost : string -> unit
val flambda2_inline_prim_cost : string -> unit
val flambda2_inline_branch_cost : string -> unit
val flambda2_inline_indirect_call_cost : string -> unit
val flambda2_inline_poly_compare_cost : string -> unit
val flambda2_inline_small_function_size : string -> unit
val flambda2_inline_large_function_size : string -> unit
val flambda2_inline_threshold : string -> unit
val flambda2_speculative_inlining_only_if_arguments_useful : unit -> unit
val no_flambda2_speculative_inlining_only_if_arguments_useful : unit -> unit
val flambda2_inlining_report_bin : unit -> unit
val flambda2_unicode : unit -> unit
val drawfexpr : unit -> unit
val drawfexpr_to : string -> unit
val dfexpr : unit -> unit
val dfexpr_to : string -> unit
val dflexpect_to : string -> unit
val dslot_offsets : unit -> unit
val dfreshen : unit -> unit
val dflow : unit -> unit
val use_cached_generic_functions : unit -> unit
val cached_generic_functions_path : string -> unit
end
(** Command line arguments required for ocamlopt.*)
module type Debugging_options = sig
val restrict_to_upstream_dwarf : unit -> unit
val no_restrict_to_upstream_dwarf : unit -> unit
val dwarf_for_startup_file : unit -> unit
val no_dwarf_for_startup_file : unit -> unit
val gdwarf_may_alter_codegen : unit -> unit
val no_gdwarf_may_alter_codegen : unit -> unit
val gdwarf_max_function_complexity : int -> unit
end
(** Command line arguments required for ocamlopt. *)
module type Optcomp_options = sig
include Main_args.Optcomp_options
include Flambda_backend_options
include Debugging_options
end
(** Command line arguments required for ocamlnat. *)
module type Opttop_options = sig
include Main_args.Opttop_options
include Flambda_backend_options
include Debugging_options
end
(** Transform required command-line arguments into actual arguments.
Each tool can define its own argument implementations and
call the right functor to actualize them into [Arg.t] list. *)
module Make_optcomp_options : Optcomp_options -> Main_args.Arg_list;;
module Make_opttop_options : Opttop_options -> Main_args.Arg_list;;
(** Default implementations of required arguments for each tool. *)
module Default: sig
module Optmain: Optcomp_options
module Opttopmain: Opttop_options
end
(** Extra_params module provides a way to read flambda-backend
flags from OCAMLPARAM. All command line flags should support it,
with the exception of debug printing, such as -dcfg.
*)
module Extra_params : sig
(** [read_param ppf pos name value] returns whether the param was handled. *)
val read_param :
Format.formatter -> Compenv.readenv_position -> string -> string -> bool
end