Skip to content

Commit

Permalink
flambda-backend: Zero alloc: propagate assume on applications of exte…
Browse files Browse the repository at this point in the history
…rnals (#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
  • Loading branch information
gretay-js authored May 7, 2024
1 parent 6ed7f37 commit e9fc28e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lambda/translcore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,12 @@ and transl_exp0 ~in_new_scope ~scopes sort e =
else Rc_normal
in
let lam =
let loc =
map_scopes (update_assume_zero_alloc ~assume_zero_alloc)
(of_location ~scopes e.exp_loc)
in
Translprim.transl_primitive_application
(of_location ~scopes e.exp_loc) p e.exp_env prim_type
loc p e.exp_env prim_type
~poly_mode:pmode ~poly_sort:psort
path prim_exp args (List.map fst arg_exps) position
in
Expand Down

0 comments on commit e9fc28e

Please sign in to comment.