Skip to content

Commit c203970

Browse files
committed
review changes
1 parent d9d773a commit c203970

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

backend/amd64/proc.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,8 @@ let max_register_pressure =
385385
consumes ~int:1 ~float:0
386386
| Istore(Single, _, _) | Icompf _ ->
387387
consumes ~int:0 ~float:1
388+
| Iendregion ->
389+
consumes ~int:1 ~float:0
388390
| Iintop(Iadd | Isub | Imul | Imulh _ | Iand | Ior | Ixor | Ilsl | Ilsr | Iasr
389391
| Ipopcnt|Iclz _| Ictz _|Icheckbound)
390392
| Iintop_imm((Iadd | Isub | Imul | Imulh _ | Iand | Ior | Ixor | Ilsl | Ilsr
@@ -404,7 +406,7 @@ let max_register_pressure =
404406
| Ioffset_loc (_, _) | Ifloatarithmem (_, _)
405407
| Ibswap _ | Ifloatsqrtf _ | Isqrtf)
406408
| Iname_for_debugger _ | Iprobe _ | Iprobe_is_enabled _ | Iopaque
407-
| Ibeginregion | Iendregion
409+
| Ibeginregion
408410
-> consumes ~int:0 ~float:0
409411

410412
(* Pure operations (without any side effect besides updating their result

backend/arm64/proc.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ let op_is_pure = function
288288
| Icall_ind | Icall_imm _ | Itailcall_ind | Itailcall_imm _
289289
| Iextcall _ | Istackoffset _ | Istore _ | Ialloc _
290290
| Iintop(Icheckbound) | Iintop_imm(Icheckbound, _) | Iopaque
291+
| Ibeginregion | Iendregion
291292
| Ispecific(Ishiftcheckbound _) -> false
292293
| _ -> true
293294

backend/cmm.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ val map_tail: (expression -> expression) -> expression -> expression
296296
by recursively applying map_shallow_tail *)
297297

298298
val iter_shallow: (expression -> unit) -> expression -> unit
299-
(** Apply the transformation to each immediate sub-expression. *)
299+
(** Apply the callback to each immediate sub-expression. *)
300300

301301
val map_shallow: (expression -> expression) -> expression -> expression
302302
(** Apply the transformation to each immediate sub-expression. *)

backend/cmm_helpers.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ let box_float dbg m c = Cop(Calloc m, [alloc_float_header m dbg; c], dbg)
611611
let unbox_float dbg =
612612
map_tail
613613
(function
614-
| Cop(Calloc Alloc_heap, [Cconst_natint (hdr, _); c], _)
614+
| Cop(Calloc _, [Cconst_natint (hdr, _); c], _)
615615
when Nativeint.equal hdr float_header ->
616616
c
617617
| Cconst_symbol (s, _dbg) as cmm ->
@@ -1190,20 +1190,20 @@ let unbox_int dbg bi =
11901190
in
11911191
map_tail
11921192
(function
1193-
| Cop(Calloc Alloc_heap,
1193+
| Cop(Calloc _,
11941194
[hdr; ops;
11951195
Cop(Clsl, [contents; Cconst_int (32, _)], _dbg')], _dbg)
11961196
when bi = Primitive.Pint32 && size_int = 8 && big_endian
11971197
&& alloc_matches_boxed_int bi ~hdr ~ops ->
11981198
(* Force sign-extension of low 32 bits *)
11991199
sign_extend_32 dbg contents
1200-
| Cop(Calloc Alloc_heap,
1200+
| Cop(Calloc _,
12011201
[hdr; ops; contents], _dbg)
12021202
when bi = Primitive.Pint32 && size_int = 8 && not big_endian
12031203
&& alloc_matches_boxed_int bi ~hdr ~ops ->
12041204
(* Force sign-extension of low 32 bits *)
12051205
sign_extend_32 dbg contents
1206-
| Cop(Calloc Alloc_heap, [hdr; ops; contents], _dbg)
1206+
| Cop(Calloc _, [hdr; ops; contents], _dbg)
12071207
when alloc_matches_boxed_int bi ~hdr ~ops ->
12081208
contents
12091209
| Cconst_symbol (s, _dbg) as cmm ->

backend/cmmgen.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ let equal_boxed_number bn1 bn2 =
285285
match bn1, bn2 with
286286
| Boxed_float _, Boxed_float _ -> true
287287
| Boxed_integer(ui1, m, _), Boxed_integer(ui2, m', _) ->
288-
equal_unboxed_integer ui1 ui2 && m = m'
288+
equal_unboxed_integer ui1 ui2 && Lambda.eq_mode m m'
289289
| _, _ -> false
290290

291291
let box_number bn arg =
@@ -526,7 +526,7 @@ let rec transl env e =
526526
bigarray_get unsafe elt_kind layout
527527
(transl env arg1) (List.map (transl env) argl) dbg in
528528
begin match elt_kind with
529-
(* TODO: local alloaction of bigarray elements *)
529+
(* TODO: local allocation of bigarray elements *)
530530
Pbigarray_float32 | Pbigarray_float64 -> box_float dbg Alloc_heap elt
531531
| Pbigarray_complex32 | Pbigarray_complex64 -> elt
532532
| Pbigarray_int32 -> box_int dbg Pint32 Alloc_heap elt

backend/comballoc.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ let rec combine i allocstate =
5858
match state with
5959
| No_alloc -> assert false
6060
| Pending_alloc { totalsz; dbginfos; mode = m; _ } ->
61-
assert (m = mode);
61+
assert (Lambda.eq_mode m mode);
6262
totalsz, dbginfos in
6363
let next =
6464
let offset = totalsz - sz in

0 commit comments

Comments
 (0)