@@ -988,6 +988,20 @@ let mk_flambda_expert_max_inlining_depth f =
988
988
" Set maximum inlining depth"
989
989
;;
990
990
991
+ let mk_flambda_expert_small_function_threshold f =
992
+ " -flambda-expert-small-function-threshold" , Arg. String f,
993
+ Printf. sprintf " <n>|<round>=<n>[,...] Functions with a cost less than this \
994
+ threshold will always be inlined (default %d)."
995
+ Clflags.Flambda.Expert. default_small_function_threshold
996
+ ;;
997
+
998
+ let mk_flambda_expert_big_function_threshold f =
999
+ " -flambda-expert-big-function-threshold" , Arg. String f,
1000
+ Printf. sprintf " <n>|<round>=<n>[,...] Functions with a cost greater than this \
1001
+ threshold will never be inlined (default %d)."
1002
+ Clflags.Flambda.Expert. default_big_function_threshold
1003
+ ;;
1004
+
991
1005
let mk_flambda_expert_max_block_size_for_projections f =
992
1006
" -flambda-expert-max-block-size-for-projections" , Arg. Int f,
993
1007
" Do not simplify projections from blocks if the block size exceeds \
@@ -1252,6 +1266,8 @@ module type Optcommon_options = sig
1252
1266
val _flambda_expert_phantom_lets : unit -> unit
1253
1267
val _no_flambda_expert_phantom_lets : unit -> unit
1254
1268
val _flambda_expert_max_inlining_depth : int -> unit
1269
+ val _flambda_expert_small_function_threshold : string -> unit
1270
+ val _flambda_expert_big_function_threshold : string -> unit
1255
1271
val _flambda_expert_max_block_size_for_projections : int -> unit
1256
1272
val _flambda_debug_permute_every_name : unit -> unit
1257
1273
val _no_flambda_debug_permute_every_name : unit -> unit
@@ -1618,6 +1634,10 @@ struct
1618
1634
F. _no_flambda_expert_phantom_lets;
1619
1635
mk_flambda_expert_max_inlining_depth
1620
1636
F. _flambda_expert_max_inlining_depth;
1637
+ mk_flambda_expert_small_function_threshold
1638
+ F. _flambda_expert_small_function_threshold;
1639
+ mk_flambda_expert_big_function_threshold
1640
+ F. _flambda_expert_big_function_threshold;
1621
1641
mk_flambda_expert_max_block_size_for_projections
1622
1642
F. _flambda_expert_max_block_size_for_projections;
1623
1643
mk_flambda_debug_permute_every_name
@@ -1782,6 +1802,10 @@ module Make_opttop_options (F : Opttop_options) = struct
1782
1802
F. _no_flambda_expert_phantom_lets;
1783
1803
mk_flambda_expert_max_inlining_depth
1784
1804
F. _flambda_expert_max_inlining_depth;
1805
+ mk_flambda_expert_small_function_threshold
1806
+ F. _flambda_expert_small_function_threshold;
1807
+ mk_flambda_expert_big_function_threshold
1808
+ F. _flambda_expert_big_function_threshold;
1785
1809
mk_flambda_expert_max_block_size_for_projections
1786
1810
F. _flambda_expert_max_block_size_for_projections;
1787
1811
mk_flambda_debug_permute_every_name
@@ -2096,6 +2120,16 @@ module Default = struct
2096
2120
clear Flambda.Expert. phantom_lets
2097
2121
let _flambda_expert_max_inlining_depth depth =
2098
2122
Flambda.Expert. max_inlining_depth := depth
2123
+ let _flambda_expert_small_function_threshold spec =
2124
+ Int_arg_helper. parse spec
2125
+ " Syntax: -flambda-expert-small-function-threshold <n> | \
2126
+ <round>=<n>[,...]"
2127
+ Flambda.Expert. small_function_threshold
2128
+ let _flambda_expert_big_function_threshold spec =
2129
+ Int_arg_helper. parse spec
2130
+ " Syntax: -flambda-expert-big-function-threshold <n> | \
2131
+ <round>=<n>[,...]"
2132
+ Flambda.Expert. big_function_threshold
2099
2133
let _flambda_expert_max_block_size_for_projections size =
2100
2134
Flambda.Expert. max_block_size_for_projections := Some size
2101
2135
let _flambda_debug_permute_every_name =
0 commit comments