Skip to content

Commit 68488a9

Browse files
vouillonhhugo
authored andcommitted
Effect through double translation: avoid introducing unused blocks
1 parent 3b5660d commit 68488a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/lib/effects.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,12 @@ let cps_transform ~live_vars ~flow_info ~cps_needed p =
947947
subst_bound_in_blocks st.new_blocks cloned_subst)
948948
else st.new_blocks
949949
in
950+
let blocks =
951+
(* Remove the initial block added only for the CPS transformation *)
952+
if double_translate () && start <> initial_start
953+
then Addr.Map.remove start blocks
954+
else blocks
955+
in
950956
let blocks = Addr.Map.fold Addr.Map.add new_blocks blocks in
951957
if debug () then Format.eprintf "@.";
952958
{ p with blocks; free_pc = st.free_pc })

0 commit comments

Comments
 (0)