Skip to content

Basic mixed blocks for float# in runtime 5 #2380

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

Merged
merged 97 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
ebc65b3
Records mixing immediates, floats, and float64s
ccasin Nov 18, 2023
a6e709b
Cleanup of names
ncik-roberts Dec 12, 2023
5506194
Slightly more intelligible implementation of record shape detection
ncik-roberts Dec 12, 2023
a42d006
Small simplification + remove comment
ncik-roberts Dec 12, 2023
857035d
More renames than before
ncik-roberts Dec 12, 2023
2744fa8
Raise on poly compare and hash
ncik-roberts Dec 13, 2023
8948a6e
Fix some, but not all, bugs in bytecomp: we segfault on the 100-gener…
ncik-roberts Dec 13, 2023
938ce15
Fix off-by-one for zero value prefix len
ncik-roberts Dec 15, 2023
c10af4b
No more runtime mixed blocks in bytecode
ncik-roberts Dec 15, 2023
e8e620d
Macroize things more
ncik-roberts Dec 15, 2023
a3c75aa
Support weak pointer shallow copy
ncik-roberts Dec 15, 2023
3157c86
A few more places where we need to check for mixed blocks
ncik-roberts Dec 15, 2023
d8bbdb4
Most issues fixed
ncik-roberts Dec 15, 2023
2304de4
Rename more 'abstract' things to 'mixed'
ncik-roberts Dec 15, 2023
9b86c13
Remove ability to mix boxed floats with unboxed floats
ncik-roberts Dec 15, 2023
3c77580
Fix bugs and more accurately track offsets
ncik-roberts Dec 15, 2023
faf1848
Fix bugs and more accurately track budgets
ncik-roberts Dec 15, 2023
d18c7d7
Get let-rec working with mixed blocks
ncik-roberts Dec 18, 2023
6e6391c
Add tests for mixed blocks
ncik-roberts Dec 18, 2023
5fa7dca
Clarify comment
ncik-roberts Dec 18, 2023
0d0e8ca
Use corrected-style tests and actually run the small generated examples
ncik-roberts Dec 18, 2023
3c00b09
Fix recursive values test
ncik-roberts Dec 18, 2023
06e8096
Fix typo in generated TEST stanza
ncik-roberts Dec 18, 2023
edf77d6
comment and format
ncik-roberts Dec 18, 2023
811e5cc
Restore support for floats
ncik-roberts Dec 29, 2023
2b1d10e
Flesh out the test suite a bit to cover records with floats in the pr…
ncik-roberts Dec 29, 2023
96af30e
Fix bug
ncik-roberts Dec 29, 2023
e060d3d
Small tweaks to comments / bugfixes in dead code
ncik-roberts Mar 13, 2024
9e03c49
Fix up Chris's old tests
ncik-roberts Mar 14, 2024
77945ca
Cleanup and comments
ncik-roberts Mar 14, 2024
ac0146a
Commit to storing floats flat in mixed-float-float# blocks
ncik-roberts Mar 15, 2024
39827c7
Actually test all floats mixed records
ncik-roberts Mar 15, 2024
0db0cee
Some progress in merging, will continue Mon
ncik-roberts Mar 15, 2024
07884ab
Finish resolving type errors related to conflicts after merge
ncik-roberts Mar 18, 2024
bf4026a
Resolve some CRs
ncik-roberts Mar 18, 2024
b057b6e
Resolve more CRs
ncik-roberts Mar 18, 2024
345c52f
Clarify that bytecode operations don't raise
ncik-roberts Mar 19, 2024
c241948
Back out an unnecessary change to backend/cmm_helpers.ml
ncik-roberts Mar 19, 2024
1eb38cc
Back out probably unnecessary changes to cmmgen.ml
ncik-roberts Mar 19, 2024
5ecbce9
Add test for too many fields to show error message
ncik-roberts Mar 19, 2024
ad5c1f6
Fix local test to actually test something. Use better macros.
ncik-roberts Mar 19, 2024
88ce596
Make polymorphic hash raise for mixed blocks
ncik-roberts Mar 19, 2024
8113ebf
Fix updating of dummy blocks
ncik-roberts Mar 19, 2024
20bda95
Add some comments about mixed blocks
ncik-roberts Mar 19, 2024
ac96e0a
Revert unintentional changes to runtime4
ncik-roberts Mar 19, 2024
0551547
Fix merge conflicts and type errors
ncik-roberts Mar 19, 2024
2e4f3ab
make fmt
ncik-roberts Mar 19, 2024
c2db203
Move mixed records to layouts alpha
ncik-roberts Mar 20, 2024
95477b4
Always set reserved header bits to 8
ncik-roberts Mar 22, 2024
e99ea6c
Reenable support for enable-profinfo-width in runtime 4
ncik-roberts Mar 22, 2024
fb0347e
Merge branch 'reserve-header-bits-in-runtime-5' into nroberts/mixed-b…
ncik-roberts Mar 22, 2024
53bfaeb
Fix segfault in printing + in no-allocness of hash
ncik-roberts Mar 22, 2024
ab8839b
Most of stedolan's comments
ncik-roberts Mar 22, 2024
28f8879
Adopt stedolan's suggestion for structure of `oldify_one` and `oldify…
ncik-roberts Mar 26, 2024
537f16c
Accept TheNumbat's suggestions
ncik-roberts Mar 26, 2024
e139851
Address rest of @TheNumbat's comments
ncik-roberts Mar 26, 2024
3b5d3a9
Revert change to conflict markers irrelevant to this PR
ncik-roberts Mar 26, 2024
d7dc293
no u
ncik-roberts Mar 26, 2024
9ad4d3c
Segregate runtime 4 and 5 tests
ncik-roberts Mar 26, 2024
939f5d6
Fix typo
ncik-roberts Mar 26, 2024
4e7ecc6
Clarify comment
ncik-roberts Mar 26, 2024
45aeddd
Clarify comment
ncik-roberts Mar 26, 2024
ea99732
Factor out a gnarly function
ncik-roberts Mar 26, 2024
30cbd43
Use mixed_block version of primitives for getting/setting value fields
ncik-roberts Apr 1, 2024
afa2a48
make fmt
ncik-roberts Apr 1, 2024
8de0389
Fix bug in all-float mixed records and fix accidental omission in tests
ncik-roberts Apr 1, 2024
3be989e
Segregate tests for all-float mixed records and mixed blocks
ncik-roberts Apr 1, 2024
0de3604
Correct comment in float64 tests
ncik-roberts Apr 1, 2024
bb8a566
Rework test structure
ncik-roberts Apr 1, 2024
ec53f58
Comment raisiness
ncik-roberts Apr 1, 2024
96bee23
Fix bug in printing
ncik-roberts Apr 1, 2024
d2f7797
Fix confusing name
ncik-roberts Apr 1, 2024
47bf56f
Flat_imm_element -> Imm_element
ncik-roberts Apr 1, 2024
143e600
Reshuffle tests so we don't get error message clashes between runtime…
ncik-roberts Apr 2, 2024
846e4ff
Stop unnecessarily numbering tests
ncik-roberts Apr 2, 2024
410a2f2
Fix upstream build
ncik-roberts Apr 2, 2024
f19dfc1
'Fix' upstream build
ncik-roberts Apr 2, 2024
b97986f
Respond to stedolan's comments
ncik-roberts Apr 2, 2024
6739afa
Respond to review of @TheNumbat and @lthls
ncik-roberts Apr 2, 2024
4056319
Fix bug in oldify_one
ncik-roberts Apr 2, 2024
d3ae768
Re-enable test of recursive value (accidentally disabled) and allow r…
ncik-roberts Apr 2, 2024
3d7894f
Simplify generated test code, and just check in full test
ncik-roberts Apr 2, 2024
b1cafee
Remove unnecessary test.reference file
ncik-roberts Apr 2, 2024
f3a0116
Fix printing bug in bytecode
ncik-roberts Apr 2, 2024
76145f8
Allow the Obj.double_field call in printing to work on mixed blocks
ncik-roberts Apr 2, 2024
1053db7
Fix tests that I accidentally broke
ncik-roberts Apr 2, 2024
420efba
Merge remote-tracking branch 'origin/main' into nroberts/mixed-blocks
ncik-roberts Apr 3, 2024
dcc9ae6
Continue rejecting mixed blocks from runtime 4 type-checker
ncik-roberts Apr 3, 2024
fdfa7e8
Resolve hash CR: implement hash differently in native code vs. bytecode
ncik-roberts Apr 3, 2024
889d3cc
Revert to hashing a constant for mixed blocks
ncik-roberts Apr 4, 2024
3b5fa24
Just take the hash of the scannable prefix
ncik-roberts Apr 4, 2024
abc4271
Minimize needless diff in runtime
ncik-roberts Apr 5, 2024
7422ae8
Re-enable an accidentally disabled test and fix a bug related to Obj.…
ncik-roberts Apr 5, 2024
fa4e61f
Slightly more consistent name (`caml_alloc_small_with_reserved`)
ncik-roberts Apr 5, 2024
46922ed
Add missing functionality and test for mixed block over young wosize …
ncik-roberts Apr 7, 2024
be70874
add new function to headers
ncik-roberts Apr 7, 2024
ef9a081
Merge remote-tracking branch 'origin/main' into nroberts/mixed-blocks
ncik-roberts Apr 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 153 additions & 33 deletions backend/cmm_helpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,97 @@ let mk_load_atomic memory_chunk =

let floatarray_tag dbg = Cconst_int (Obj.double_array_tag, dbg)

type t =
| Scan_all
| Scan_prefix of int

module Mixed_block_support : sig
val assert_mixed_block_support : unit -> unit

val make_header : Nativeint.t -> scannable_prefix:int -> Nativeint.t
end = struct
(* CR mixed blocks v1: This "8" is duplicated in [typedecl.ml]. We should fix
up this duplication when we make the "8" configurable. *)
let required_reserved_header_bits = 8

let required_addr_size_bits = 64

(* Many of these checks are duplicated *)

(* CR mixed blocks v1: This is also duplicated in [typedecl.ml]. *)
(* Why 2? We'd subtract 1 if the mixed block encoding could use all 8 bits of
the prefix. But the all-0 prefix means "not a mixed block", so we can't use
the all-0 pattern, and we must subtract 2 instead. *)
let max_scannable_prefix = (1 lsl required_reserved_header_bits) - 2

let max_header =
(1 lsl (required_addr_size_bits - required_reserved_header_bits)) - 1
|> Nativeint.of_int

let assert_mixed_block_support =
lazy
(if not Config.runtime5
then Misc.fatal_error "Mixed blocks are only supported in runtime5";
if not Config.native_compiler
then Misc.fatal_error "Mixed blocks are only supported in native code";
let reserved_header_bits = Config.reserved_header_bits in
let addr_size_bits = Arch.size_addr * 8 in
match
( reserved_header_bits = required_reserved_header_bits,
addr_size_bits = required_addr_size_bits )
with
| true, true -> ()
| false, true ->
Misc.fatal_errorf
"Need %d reserved header bits for mixed blocks; got %d"
required_reserved_header_bits reserved_header_bits
| _, false ->
Misc.fatal_errorf
"Mixed blocks only supported on %d bit platforms; got %d"
required_addr_size_bits addr_size_bits)

let assert_mixed_block_support () = Lazy.force assert_mixed_block_support

let make_header header ~scannable_prefix =
assert_mixed_block_support ();
if scannable_prefix > max_scannable_prefix
then
Misc.fatal_errorf "Scannable prefix too big (%d > %d)" scannable_prefix
max_scannable_prefix;
(* This means we crash the compiler if someone tries to write a mixed record
with too many fields, but you effectively can't: you'd need something
like 2^46 fields. *)
if header > max_header
then
Misc.fatal_errorf
"Header too big for the mixed block encoding to be added (%nd > %nd)"
header max_header;
Nativeint.add
(Nativeint.shift_left
(Nativeint.of_int (scannable_prefix + 1))
(required_addr_size_bits - required_reserved_header_bits))
header
end

(* CR mshinwell: update to use NOT_MARKABLE terminology *)
let block_header tag sz =
Nativeint.add
(Nativeint.shift_left (Nativeint.of_int sz) 10)
(Nativeint.of_int tag)
let block_header ?(scannable_prefix = Scan_all) tag sz =
let hdr =
Nativeint.add
(Nativeint.shift_left (Nativeint.of_int sz) 10)
(Nativeint.of_int tag)
in
match scannable_prefix with
| Scan_all -> hdr
| Scan_prefix scannable_prefix ->
Mixed_block_support.make_header hdr ~scannable_prefix

(* Static data corresponding to "value"s must be marked black in case we are in
no-naked-pointers mode. See [caml_darken] and the code below that emits
structured constants and static module definitions. *)
let black_block_header tag sz = Nativeint.logor (block_header tag sz) caml_black

let local_block_header tag sz = Nativeint.logor (block_header tag sz) caml_local
let local_block_header ?scannable_prefix tag sz =
Nativeint.logor (block_header ?scannable_prefix tag sz) caml_local

let white_closure_header sz = block_header Obj.closure_tag sz

Expand Down Expand Up @@ -1318,15 +1397,16 @@ let call_cached_method obj tag cache pos args args_type result (apos, mode) dbg

(* Allocation *)

let make_alloc_generic ~mode set_fn dbg tag wordsize args =
let make_alloc_generic ?(scannable_prefix = Scan_all) ~mode set_fn dbg tag
wordsize args =
(* allocs of size 0 must be statically allocated else the Gc will bug *)
assert (List.compare_length_with args 0 > 0);
if Lambda.is_local_mode mode || wordsize <= Config.max_young_wosize
then
let hdr =
match mode with
| Lambda.Alloc_local -> local_block_header tag wordsize
| Lambda.Alloc_heap -> block_header tag wordsize
| Lambda.Alloc_local -> local_block_header ~scannable_prefix tag wordsize
| Lambda.Alloc_heap -> block_header ~scannable_prefix tag wordsize
in
Cop (Calloc mode, Cconst_natint (hdr, dbg) :: args, dbg)
else
Expand All @@ -1335,17 +1415,26 @@ let make_alloc_generic ~mode set_fn dbg tag wordsize args =
| [] -> Cvar id
| e1 :: el ->
Csequence
( set_fn (Cvar id) (Cconst_int (idx, dbg)) e1 dbg,
fill_fields (idx + 2) el )
( set_fn idx (Cvar id) (int_const dbg idx) e1 dbg,
fill_fields (idx + 1) el )
in
let caml_alloc_func, caml_alloc_args =
match Config.runtime5, scannable_prefix with
| true, Scan_all -> "caml_alloc_shr_check_gc", [wordsize; tag]
| false, Scan_all -> "caml_alloc", [wordsize; tag]
| true, Scan_prefix prefix_len ->
Mixed_block_support.assert_mixed_block_support ();
"caml_alloc_mixed_shr_check_gc", [wordsize; tag; prefix_len]
| false, Scan_prefix _ ->
Misc.fatal_error
"mixed blocks not implemented for runtime 4. (It uses the PROFINFO \
configuration instead of HEADER_RESERVED_WORDS.)"
in
Clet
( VP.create id,
Cop
( Cextcall
{ func =
(if Config.runtime5
then "caml_alloc_shr_check_gc"
else "caml_alloc");
{ func = caml_alloc_func;
ty = typ_val;
alloc = true;
builtin = false;
Expand All @@ -1354,33 +1443,61 @@ let make_alloc_generic ~mode set_fn dbg tag wordsize args =
coeffects = Has_coeffects;
ty_args = []
},
[Cconst_int (wordsize, dbg); Cconst_int (tag, dbg)],
List.map (fun arg -> Cconst_int (arg, dbg)) caml_alloc_args,
dbg ),
fill_fields 1 args )
fill_fields 0 args )

let addr_array_init arr ofs newval dbg =
Cop
( Cextcall
{ func = "caml_initialize";
ty = typ_void;
alloc = false;
builtin = false;
returns = true;
effects = Arbitrary_effects;
coeffects = Has_coeffects;
ty_args = []
},
[array_indexing log2_size_addr arr ofs dbg; newval],
dbg )

let make_alloc ~mode dbg tag args =
let addr_array_init arr ofs newval dbg =
Cop
( Cextcall
{ func = "caml_initialize";
ty = typ_void;
alloc = false;
builtin = false;
returns = true;
effects = Arbitrary_effects;
coeffects = Has_coeffects;
ty_args = []
},
[array_indexing log2_size_addr arr ofs dbg; newval],
dbg )
in
make_alloc_generic ~mode addr_array_init dbg tag (List.length args) args
make_alloc_generic ~mode
(fun _ arr ofs newval dbg -> addr_array_init arr ofs newval dbg)
dbg tag (List.length args) args

let make_float_alloc ~mode dbg tag args =
make_alloc_generic ~mode float_array_set dbg tag
make_alloc_generic ~mode
(fun _ -> float_array_set)
dbg tag
(List.length args * size_float / size_addr)
args

let make_mixed_alloc ~mode dbg shape args =
let ({ value_prefix_len; flat_suffix } : Lambda.mixed_block_shape) = shape in
(* args with shape [Float] must already have been unboxed. *)
let set_fn idx arr ofs newval dbg =
if idx < value_prefix_len
then addr_array_init arr ofs newval dbg
else
match flat_suffix.(idx - value_prefix_len) with
| Imm -> int_array_set arr ofs newval dbg
| Float | Float64 -> float_array_set arr ofs newval dbg
in
let size =
let values, floats = Lambda.count_mixed_block_values_and_floats shape in
if size_float <> size_addr
then
Misc.fatal_error
"Unable to compile mixed blocks on a platform where a float is not the \
same width as a value.";
values + floats
in
make_alloc_generic ~scannable_prefix:(Scan_prefix value_prefix_len) ~mode
(* CR mixed blocks v1: Support inline record args to variants. *)
set_fn dbg Obj.first_non_constant_constructor_tag size args

(* Record application and currying functions *)

let apply_function_name arity result (mode : Lambda.alloc_mode) =
Expand Down Expand Up @@ -3738,3 +3855,6 @@ let allocate_unboxed_int64_array =

let allocate_unboxed_nativeint_array =
allocate_unboxed_int64_or_nativeint_array custom_ops_unboxed_nativeint_array

(* Drop internal optional arguments from exported interface *)
let block_header x y = block_header x y
9 changes: 9 additions & 0 deletions backend/cmm_helpers.mli
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,15 @@ val make_alloc :
val make_float_alloc :
mode:Lambda.alloc_mode -> Debuginfo.t -> int -> expression list -> expression

(** Allocate an mixed block of the corresponding shape. Initial values of
the flat suffix should be provided unboxed. *)
val make_mixed_alloc :
mode:Lambda.alloc_mode ->
Debuginfo.t ->
Lambda.mixed_block_shape ->
expression list ->
expression

(** Sys.opaque_identity *)
val opaque : expression -> Debuginfo.t -> expression

Expand Down
15 changes: 9 additions & 6 deletions middle_end/flambda2/from_lambda/closure_conversion.ml
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,9 @@ let close_primitive acc env ~let_bound_ids_with_kinds named
| Some exn_continuation -> exn_continuation
in
close_raise0 acc env ~raise_kind ~arg ~dbg exn_continuation
| (Pmakeblock _ | Pmakefloatblock _ | Pmakeufloatblock _ | Pmakearray _), []
->
| ( ( Pmakeblock _ | Pmakefloatblock _ | Pmakeufloatblock _ | Pmakearray _
| Pmakemixedblock _ ),
[] ) ->
(* Special case for liftable empty block or array *)
let acc, sym =
match prim with
Expand All @@ -814,6 +815,8 @@ let close_primitive acc env ~let_bound_ids_with_kinds named
Misc.fatal_error "Unexpected empty float block in [Closure_conversion]"
| Pmakeufloatblock _ ->
Misc.fatal_error "Unexpected empty float# block in [Closure_conversion]"
| Pmakemixedblock _ ->
Misc.fatal_error "Unexpected empty mixed block in [Closure_conversion]"
| Pmakearray (array_kind, _, _mode) ->
let array_kind = Empty_array_kind.of_lambda array_kind in
register_const0 acc (Static_const.empty_array array_kind) "empty_array"
Expand All @@ -822,10 +825,10 @@ let close_primitive acc env ~let_bound_ids_with_kinds named
| Pfield _ | Pfield_computed _ | Psetfield _ | Psetfield_computed _
| Pfloatfield _ | Psetfloatfield _ | Pduprecord _ | Pccall _ | Praise _
| Pufloatfield _ | Psetufloatfield _ | Psequand | Psequor | Pnot | Pnegint
| Paddint | Psubint | Pmulint | Pdivint _ | Pmodint _ | Pandint | Porint
| Pxorint | Plslint | Plsrint | Pasrint | Pintcomp _ | Pcompare_ints
| Pcompare_floats _ | Pcompare_bints _ | Poffsetint _ | Poffsetref _
| Pintoffloat _
| Pmixedfield _ | Psetmixedfield _ | Paddint | Psubint | Pmulint
| Pdivint _ | Pmodint _ | Pandint | Porint | Pxorint | Plslint | Plsrint
| Pasrint | Pintcomp _ | Pcompare_ints | Pcompare_floats _
| Pcompare_bints _ | Poffsetint _ | Poffsetref _ | Pintoffloat _
| Pfloatofint (_, _)
| Pnegfloat (_, _)
| Pabsfloat (_, _)
Expand Down
34 changes: 28 additions & 6 deletions middle_end/flambda2/from_lambda/dissect_letrec.ml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ type block_type =
| Normal of int
(* tag *)
| Flat_float_record
| Mixed of Lambda.mixed_block_shape

type block =
{ block_type : block_type;
Expand Down Expand Up @@ -270,6 +271,11 @@ let rec prepare_letrec (recursive_set : Ident.Set.t)
match current_let with
| Some cl -> build_block cl (List.length args) Flat_float_record lam letrec
| None -> dead_code lam letrec)
| Lprim (Pmakemixedblock (_, shape, mode), args, _) -> (
assert_not_local ~lam mode;
match current_let with
| Some cl -> build_block cl (List.length args) (Mixed shape) lam letrec
| None -> dead_code lam letrec)
| Lprim (Pduprecord (kind, size), args, _) -> (
match current_let with
| Some cl -> (
Expand All @@ -286,6 +292,9 @@ let rec prepare_letrec (recursive_set : Ident.Set.t)
build_block cl (size + 1) (Normal 0) arg letrec
| Record_float | Record_ufloat ->
build_block cl size Flat_float_record arg letrec
| Record_mixed mixed ->
let mixed = Lambda.transl_mixed_record_shape mixed in
build_block cl size (Mixed mixed) arg letrec
| Record_inlined (Extension _, _)
| Record_inlined (Ordinary _, (Variant_unboxed | Variant_extensible))
| Record_unboxed ->
Expand Down Expand Up @@ -563,16 +572,29 @@ let dissect_letrec ~bindings ~body ~free_vars_kind =
}
in
let preallocations =
let alloc_normal_dummy cfun size =
let desc = Lambda.simple_prim_on_values ~name:cfun ~arity:1 ~alloc:true in
let size : lambda = Lconst (Const_base (Const_int size)) in
Lprim (Pccall desc, [size], Loc_unknown)
in
let alloc_mixed_dummy cfun (shape : Lambda.mixed_block_shape) size =
let size = Lconst (Const_base (Const_int size)) in
let value_prefix_len =
Lconst (Const_base (Const_int shape.value_prefix_len))
in
let desc = Lambda.simple_prim_on_values ~name:cfun ~arity:2 ~alloc:true in
Lprim (Pccall desc, [size; value_prefix_len], Loc_unknown)
in
List.map
(fun (id, { block_type; size }) ->
let fn =
let ccall =
match block_type with
| Normal _tag -> "caml_alloc_dummy"
| Flat_float_record -> "caml_alloc_dummy_float"
| Normal _tag -> alloc_normal_dummy "caml_alloc_dummy" size
| Flat_float_record ->
alloc_normal_dummy "caml_alloc_dummy_float" size
| Mixed shape -> alloc_mixed_dummy "caml_alloc_dummy_mixed" shape size
in
let desc = Lambda.simple_prim_on_values ~name:fn ~arity:1 ~alloc:true in
let size : lambda = Lconst (Const_base (Const_int size)) in
id, Lprim (Pccall desc, [size], Loc_unknown))
id, ccall)
letrec.blocks
in
let body = if not letrec.needs_region then body else Lexclave body in
Expand Down
7 changes: 4 additions & 3 deletions middle_end/flambda2/from_lambda/lambda_to_flambda.ml
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,10 @@ let primitive_can_raise (prim : Lambda.primitive) =
| Pmakefloatblock _ | Pfield _ | Pfield_computed _ | Psetfield _
| Psetfield_computed _ | Pfloatfield _ | Psetfloatfield _ | Pduprecord _
| Pmakeufloatblock _ | Pufloatfield _ | Psetufloatfield _ | Psequand | Psequor
| Pnot | Pnegint | Paddint | Psubint | Pmulint | Pandint | Porint | Pxorint
| Plslint | Plsrint | Pasrint | Pintcomp _ | Pcompare_ints | Pcompare_floats _
| Pcompare_bints _ | Poffsetint _ | Poffsetref _ | Pintoffloat _
| Pmixedfield _ | Psetmixedfield _ | Pmakemixedblock _ | Pnot | Pnegint
| Paddint | Psubint | Pmulint | Pandint | Porint | Pxorint | Plslint | Plsrint
| Pasrint | Pintcomp _ | Pcompare_ints | Pcompare_floats _ | Pcompare_bints _
| Poffsetint _ | Poffsetref _ | Pintoffloat _
| Pfloatofint (_, _)
| Pnegfloat (_, _)
| Pabsfloat (_, _)
Expand Down
Loading
Loading