We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54dec2c commit 95a2deeCopy full SHA for 95a2dee
middle_end/flambda2/from_lambda/closure_conversion_aux.ml
@@ -1051,7 +1051,12 @@ module Let_with_acc = struct
1051
| Prim (prim, _) -> Flambda_primitive.at_most_generative_effects prim
1052
| Simple _ | Static_consts _ | Set_of_closures _ | Rec_info _ -> true
1053
in
1054
- if is_unused_singleton && has_no_effects
+ let keep_bindings_for_simplify =
1055
+ (* When using Simplify, we don't delete unused bindings here, to increase
1056
+ the chance that invalid code is actually simplified to [Invalid]. *)
1057
+ not (Flambda_features.classic_mode ())
1058
+ in
1059
+ if is_unused_singleton && has_no_effects && not keep_bindings_for_simplify
1060
then acc, body
1061
else
1062
let cost_metrics_of_defining_expr =
0 commit comments