Skip to content

Commit 038d88e

Browse files
Ekdohibsmshinwell
andauthored
Prepare translation of primitives in lambda_to_flambda for unboxed products (#1465)
Co-authored-by: Mark Shinwell <[email protected]>
1 parent a1148c6 commit 038d88e

10 files changed

+818
-750
lines changed

middle_end/flambda2/from_lambda/closure_conversion.ml

Lines changed: 238 additions & 181 deletions
Large diffs are not rendered by default.

middle_end/flambda2/from_lambda/closure_conversion.mli

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ module Expr_with_acc = Closure_conversion_aux.Expr_with_acc
2525
val close_let :
2626
Acc.t ->
2727
Env.t ->
28-
Ident.t ->
28+
(Ident.t * Flambda_kind.With_subkind.t) list ->
2929
IR.user_visible ->
30-
Flambda_kind.With_subkind.t ->
3130
IR.named ->
3231
body:(Acc.t -> Env.t -> Expr_with_acc.t) ->
3332
Expr_with_acc.t
@@ -70,6 +69,15 @@ val close_switch :
7069
IR.switch ->
7170
Expr_with_acc.t
7271

72+
val close_raise :
73+
Acc.t ->
74+
Env.t ->
75+
raise_kind:Lambda.raise_kind ->
76+
arg:IR.simple ->
77+
dbg:Debuginfo.t ->
78+
IR.exn_continuation ->
79+
Expr_with_acc.t
80+
7381
type 'a close_program_metadata =
7482
| Normal : [`Normal] close_program_metadata
7583
| Classic :

middle_end/flambda2/from_lambda/closure_conversion_aux.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module IR = struct
3939
| End_region of Ident.t
4040
| Prim of
4141
{ prim : Lambda.primitive;
42-
args : simple list;
42+
args : simple list list;
4343
loc : Lambda.scoped_location;
4444
exn_continuation : exn_continuation option;
4545
region : Ident.t
@@ -92,7 +92,10 @@ module IR = struct
9292
| End_region id -> fprintf ppf "@[<2>(End_region@ %a)@]" Ident.print id
9393
| Prim { prim; args; _ } ->
9494
fprintf ppf "@[<2>(%a %a)@]" Printlambda.primitive prim
95-
(Format.pp_print_list ~pp_sep:Format.pp_print_space print_simple)
95+
(Format.pp_print_list ~pp_sep:Format.pp_print_space (fun ppf arg ->
96+
fprintf ppf "@[<2>(%a)@]"
97+
(Format.pp_print_list ~pp_sep:Format.pp_print_space print_simple)
98+
arg))
9699
args
97100
end
98101

middle_end/flambda2/from_lambda/closure_conversion_aux.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module IR : sig
4343
don't exist in Lambda *)
4444
| Prim of
4545
{ prim : Lambda.primitive;
46-
args : simple list;
46+
args : simple list list;
4747
loc : Lambda.scoped_location;
4848
exn_continuation : exn_continuation option;
4949
region : Ident.t

middle_end/flambda2/from_lambda/lambda_to_flambda.ml

Lines changed: 90 additions & 156 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)