Skip to content

Commit e9fc28e

Browse files
authored
flambda-backend: Zero alloc: propagate assume on applications of externals (#2459)
* Add a test * Propagate assume on applications of primitives * Fix new test * Add a test for % builtin * Regenerate dune.inc * Fix test failure with heap_allocation
1 parent 6ed7f37 commit e9fc28e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lambda/translcore.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,12 @@ and transl_exp0 ~in_new_scope ~scopes sort e =
410410
else Rc_normal
411411
in
412412
let lam =
413+
let loc =
414+
map_scopes (update_assume_zero_alloc ~assume_zero_alloc)
415+
(of_location ~scopes e.exp_loc)
416+
in
413417
Translprim.transl_primitive_application
414-
(of_location ~scopes e.exp_loc) p e.exp_env prim_type
418+
loc p e.exp_env prim_type
415419
~poly_mode:pmode ~poly_sort:psort
416420
path prim_exp args (List.map fst arg_exps) position
417421
in

0 commit comments

Comments
 (0)