Skip to content

Commit 38c4962

Browse files
committed
Dissect_letrec use exclave
1 parent bc7f2d7 commit 38c4962

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

middle_end/flambda2/from_lambda/dissect_letrec.ml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -575,19 +575,7 @@ let dissect_letrec ~bindings ~body =
575575
id, Lprim (Pccall desc, [size], Loc_unknown))
576576
letrec.blocks
577577
in
578-
let real_body = body in
579-
let bound_ids_freshening =
580-
List.map (fun (bound_id, _) -> bound_id, Ident.rename bound_id) bindings
581-
|> Ident.Map.of_list
582-
in
583-
let cont = next_raise_count () in
584-
let body =
585-
if not letrec.needs_region
586-
then body
587-
else
588-
let args = List.map (fun (bound_id, _) -> Lvar bound_id) bindings in
589-
Lstaticraise (cont, args)
590-
in
578+
let body = if not letrec.needs_region then body else Lexclave body in
591579
let effects_then_body = lsequence (letrec.effects, body) in
592580
let functions =
593581
match letrec.functions with
@@ -617,19 +605,7 @@ let dissect_letrec ~bindings ~body =
617605
body ))
618606
with_preallocations letrec.consts
619607
in
620-
let substituted = Lambda.rename letrec.substitution with_constants in
621-
let body_layout = Lambda.layout_top in
622-
if not letrec.needs_region
623-
then substituted
624-
else
625-
Lstaticcatch
626-
( Lregion (Lambda.rename bound_ids_freshening substituted, body_layout),
627-
( cont,
628-
List.map
629-
(fun (bound_id, _) -> bound_id, Lambda.layout_letrec)
630-
bindings ),
631-
real_body,
632-
body_layout )
608+
Lambda.rename letrec.substitution with_constants
633609

634610
type dissected =
635611
| Dissected of Lambda.lambda

0 commit comments

Comments
 (0)