Skip to content

Commit 176fae6

Browse files
committed
Compiler: convert caml_atomic_load_field into a field
1 parent cd45042 commit 176fae6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/lib/eval.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,10 @@ let eval_instr update_count inline_constant ~target info i =
558558
in Specialize_js, which would make the call to [the_const_of]
559559
below fail. *)
560560
[ i ]
561+
| Let (x, Prim (Extern "caml_atomic_load_field", [ Pv o; f ])) -> (
562+
match the_int info f with
563+
| None -> [ i ]
564+
| Some i -> [ Let (x, Field (o, Targetint.to_int_exn i, Non_float)) ])
561565
| Let (x, Prim (IsInt, [ y ])) -> (
562566
match is_int info y with
563567
| Unknown -> [ i ]

0 commit comments

Comments
 (0)