Skip to content

Commit 465ea14

Browse files
committed
Formatting
1 parent 1bf5126 commit 465ea14

File tree

6 files changed

+30
-30
lines changed

6 files changed

+30
-30
lines changed

middle_end/flambda2/from_lambda/lambda_to_flambda_primitives.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,8 +1460,7 @@ let convert_lprim ~big_endian (prim : L.primitive) (args : Simple.t list list)
14601460
| Mread_flat_suffix read ->
14611461
Flat_suffix
14621462
(match read with
1463-
| Flat_read flat_element ->
1464-
K.from_lambda_flat_element flat_element
1463+
| Flat_read flat_element -> K.from_lambda_flat_element flat_element
14651464
| Flat_read_float_boxed _ -> K.naked_float)
14661465
in
14671466
let shape = K.Mixed_block_shape.from_lambda shape in

middle_end/flambda2/kinds/flambda_kind.ml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ module Mixed_block_shape = struct
188188
lambda_shape.value_prefix_len
189189

190190
let equal t1 t2 =
191-
Int.equal (Array.length t1.fields) (Array.length t2.fields) &&
192-
Array.for_all2 equal t1.fields t2.fields
191+
Int.equal (Array.length t1.fields) (Array.length t2.fields)
192+
&& Array.for_all2 equal t1.fields t2.fields
193193

194194
let compare t1 t2 =
195195
let length1 = Array.length t1.fields in
@@ -212,8 +212,7 @@ module Mixed_block_shape = struct
212212
List.init shape.value_prefix_len (fun _ -> Value)
213213
in
214214
let flat_suffix_shape =
215-
List.map from_lambda_flat_element
216-
(Array.to_list shape.flat_suffix)
215+
List.map from_lambda_flat_element (Array.to_list shape.flat_suffix)
217216
in
218217
{ fields = Array.of_list (value_prefix_shape @ flat_suffix_shape);
219218
lambda_shape = shape

middle_end/flambda2/parser/print_fexpr.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,7 @@ let block_access_kind ppf (access_kind : block_access_kind) =
481481
match field_kind with
482482
| Value_prefix Any_value -> ()
483483
| Value_prefix Immediate -> Format.fprintf ppf "@ imm"
484-
| Flat_suffix flat ->
485-
Format.fprintf ppf "@ %a"
486-
Flambda_kind.print flat
484+
| Flat_suffix flat -> Format.fprintf ppf "@ %a" Flambda_kind.print flat
487485
in
488486
match access_kind with
489487
| Values { field_kind; tag; size } ->

middle_end/flambda2/simplify/unboxing/unboxing_epa.ml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,9 @@ and compute_extra_args_for_block ~pass rewrite_id ~typing_env_at_use
253253
let field_kind = (K.Mixed_block_shape.field_kinds shape).(index) in
254254
if index < K.Mixed_block_shape.value_prefix_size shape
255255
then
256-
(* CR vlaviron: we're not trying to infer if this can only be an immediate.
257-
In most cases it should be fine, as the primitive will get simplified away. *)
256+
(* CR vlaviron: we're not trying to infer if this can only be an
257+
immediate. In most cases it should be fine, as the primitive will
258+
get simplified away. *)
258259
( P.Mixed_block_access_field_kind.Value_prefix Any_value,
259260
Const.const_zero )
260261
else
@@ -380,14 +381,16 @@ and compute_extra_args_for_variant ~pass rewrite_id ~typing_env_at_use
380381
Naked_floats { size = Known (Targetint_31_63.of_int size) }
381382
| Mixed_record shape ->
382383
let field_kind =
383-
let field_kind = (K.Mixed_block_shape.field_kinds shape).(index) in
384+
let field_kind =
385+
(K.Mixed_block_shape.field_kinds shape).(index)
386+
in
384387
if index < K.Mixed_block_shape.value_prefix_size shape
385388
then
386-
(* CR vlaviron: we're not trying to infer if this can only be an immediate.
387-
In most cases it should be fine, as the primitive will get simplified away. *)
389+
(* CR vlaviron: we're not trying to infer if this can only be an
390+
immediate. In most cases it should be fine, as the primitive
391+
will get simplified away. *)
388392
P.Mixed_block_access_field_kind.Value_prefix Any_value
389-
else
390-
P.Mixed_block_access_field_kind.Flat_suffix field_kind
393+
else P.Mixed_block_access_field_kind.Flat_suffix field_kind
391394
in
392395
Mixed
393396
{ tag = Known tag_decision;

middle_end/flambda2/terms/code_size.ml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,7 @@ let block_set (kind : Flambda_primitive.Block_access_kind.t)
159159
does_not_need_caml_c_call_extcall_size (* caml_modify *)
160160
| Values _, (Assignment Local | Initialization) -> 1 (* cadda + store *)
161161
| Naked_floats _, (Assignment _ | Initialization) -> 1
162-
| ( Mixed
163-
{ field_kind =
164-
( Value_prefix _
165-
| Flat_suffix _
166-
);
167-
_
168-
},
162+
| ( Mixed { field_kind = Value_prefix _ | Flat_suffix _; _ },
169163
(Assignment _ | Initialization) ) ->
170164
1
171165

middle_end/flambda2/to_cmm/to_cmm_primitive.ml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,24 @@ let block_load ~dbg (kind : P.Block_access_kind.t) (mutability : Mutability.t)
111111
| Mixed { field_kind = Flat_suffix field_kind; _ } -> (
112112
match field_kind with
113113
| Value ->
114-
(* The flat suffix cannot store scannable values, so this must be an immediate *)
114+
(* The flat suffix cannot store scannable values, so this must be an
115+
immediate *)
115116
C.get_field_computed Immediate mutability ~block ~index dbg
116117
| Naked_number Naked_float ->
117118
(* CR layouts v5.1: We should use the mutability here to generate better
118119
code if the load is immutable. *)
119120
C.unboxed_float_array_ref block index dbg
120-
| Naked_number Naked_float32 -> C.get_field_unboxed_float32 mutability ~block ~index dbg
121-
| Naked_number Naked_int32 -> C.get_field_unboxed_int32 mutability ~block ~index dbg
121+
| Naked_number Naked_float32 ->
122+
C.get_field_unboxed_float32 mutability ~block ~index dbg
123+
| Naked_number Naked_int32 ->
124+
C.get_field_unboxed_int32 mutability ~block ~index dbg
122125
| Naked_number (Naked_int64 | Naked_nativeint) ->
123126
C.get_field_unboxed_int64_or_nativeint mutability ~block ~index dbg
124127
| Naked_number Naked_vec128 ->
125128
Misc.fatal_error "Naked_vec128 not supported in mixed blocks"
126129
| Naked_number Naked_immediate | Region | Rec_info ->
127-
Misc.fatal_errorf "Unexpected kind in mixed block field: %a" K.print field_kind)
130+
Misc.fatal_errorf "Unexpected kind in mixed block field: %a" K.print
131+
field_kind)
128132

129133
let block_set ~dbg (kind : P.Block_access_kind.t) (init : P.Init_or_assign.t)
130134
~block ~index ~new_value =
@@ -144,14 +148,17 @@ let block_set ~dbg (kind : P.Block_access_kind.t) (init : P.Init_or_assign.t)
144148
(* See comment in [block_load] about assuming [Immediate] *)
145149
C.setfield_computed Immediate init_or_assign block index new_value dbg
146150
| Naked_number Naked_float -> C.float_array_set block index new_value dbg
147-
| Naked_number Naked_float32 -> C.setfield_unboxed_float32 block index new_value dbg
148-
| Naked_number Naked_int32 -> C.setfield_unboxed_int32 block index new_value dbg
151+
| Naked_number Naked_float32 ->
152+
C.setfield_unboxed_float32 block index new_value dbg
153+
| Naked_number Naked_int32 ->
154+
C.setfield_unboxed_int32 block index new_value dbg
149155
| Naked_number (Naked_int64 | Naked_nativeint) ->
150156
C.setfield_unboxed_int64_or_nativeint block index new_value dbg
151157
| Naked_number Naked_vec128 ->
152158
Misc.fatal_error "Naked_vec128 not supported in mixed blocks"
153159
| Naked_number Naked_immediate | Region | Rec_info ->
154-
Misc.fatal_errorf "Unexpected kind in mixed block field: %a" K.print field_kind)
160+
Misc.fatal_errorf "Unexpected kind in mixed block field: %a" K.print
161+
field_kind)
155162
in
156163
C.return_unit dbg expr
157164

0 commit comments

Comments
 (0)