Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare translation of primitives in lambda_to_flambda for unboxed products #1465

Merged
merged 10 commits into from
Jun 14, 2023
419 changes: 238 additions & 181 deletions middle_end/flambda2/from_lambda/closure_conversion.ml

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions middle_end/flambda2/from_lambda/closure_conversion.mli
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ module Expr_with_acc = Closure_conversion_aux.Expr_with_acc
val close_let :
Acc.t ->
Env.t ->
Ident.t ->
(Ident.t * Flambda_kind.With_subkind.t) list ->
IR.user_visible ->
Flambda_kind.With_subkind.t ->
IR.named ->
body:(Acc.t -> Env.t -> Expr_with_acc.t) ->
Expr_with_acc.t
Expand Down Expand Up @@ -70,6 +69,15 @@ val close_switch :
IR.switch ->
Expr_with_acc.t

val close_raise :
Acc.t ->
Env.t ->
raise_kind:Lambda.raise_kind ->
arg:IR.simple ->
dbg:Debuginfo.t ->
IR.exn_continuation ->
Expr_with_acc.t

type 'a close_program_metadata =
| Normal : [`Normal] close_program_metadata
| Classic :
Expand Down
7 changes: 5 additions & 2 deletions middle_end/flambda2/from_lambda/closure_conversion_aux.ml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module IR = struct
| End_region of Ident.t
| Prim of
{ prim : Lambda.primitive;
args : simple list;
args : simple list list;
loc : Lambda.scoped_location;
exn_continuation : exn_continuation option;
region : Ident.t
Expand Down Expand Up @@ -92,7 +92,10 @@ module IR = struct
| End_region id -> fprintf ppf "@[<2>(End_region@ %a)@]" Ident.print id
| Prim { prim; args; _ } ->
fprintf ppf "@[<2>(%a %a)@]" Printlambda.primitive prim
(Format.pp_print_list ~pp_sep:Format.pp_print_space print_simple)
(Format.pp_print_list ~pp_sep:Format.pp_print_space (fun ppf arg ->
fprintf ppf "@[<2>(%a)@]"
(Format.pp_print_list ~pp_sep:Format.pp_print_space print_simple)
arg))
args
end

Expand Down
2 changes: 1 addition & 1 deletion middle_end/flambda2/from_lambda/closure_conversion_aux.mli
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module IR : sig
don't exist in Lambda *)
| Prim of
{ prim : Lambda.primitive;
args : simple list;
args : simple list list;
loc : Lambda.scoped_location;
exn_continuation : exn_continuation option;
region : Ident.t
Expand Down
246 changes: 90 additions & 156 deletions middle_end/flambda2/from_lambda/lambda_to_flambda.ml

Large diffs are not rendered by default.

Loading