Skip to content

Commit f59e124

Browse files
committed
unknown_types_from_arity
1 parent 7746c89 commit f59e124

File tree

4 files changed

+7
-18
lines changed

4 files changed

+7
-18
lines changed

middle_end/flambda2/simplify/simplify_apply_expr.ml

+6-7
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ let simplify_direct_full_application0 ~simplify_expr dacc apply function_type
212212
DA.record_continuation_use dacc apply_return_continuation
213213
(Non_inlinable { escaping = true })
214214
~env_at_use:(DA.denv dacc)
215-
~arg_types:(T.unknown_types_from_arity_with_subkinds result_arity)
215+
~arg_types:(T.unknown_types_from_arity result_arity)
216216
in
217217
dacc, Some use_id, result_continuation
218218
| Return apply_return_continuation, Ok result_types ->
@@ -285,7 +285,7 @@ let simplify_direct_full_application0 ~simplify_expr dacc apply function_type
285285
(Non_inlinable { escaping = true })
286286
~env_at_use:(DA.denv dacc)
287287
~arg_types:
288-
(T.unknown_types_from_arity_with_subkinds
288+
(T.unknown_types_from_arity
289289
(Exn_continuation.arity (Apply.exn_continuation apply)))
290290
in
291291
let apply = Apply.with_continuation apply result_continuation in
@@ -839,15 +839,14 @@ let simplify_function_call_where_callee's_type_unavailable dacc apply
839839
(Non_inlinable { escaping = true })
840840
~env_at_use:(DA.denv dacc)
841841
~arg_types:
842-
(T.unknown_types_from_arity_with_subkinds
842+
(T.unknown_types_from_arity
843843
(Exn_continuation.arity (Apply.exn_continuation apply)))
844844
in
845845
let dacc, use_id =
846846
DA.record_continuation_use dacc cont
847847
(Non_inlinable { escaping = true })
848848
~env_at_use
849-
~arg_types:
850-
(T.unknown_types_from_arity_with_subkinds (Apply.return_arity apply))
849+
~arg_types:(T.unknown_types_from_arity (Apply.return_arity apply))
851850
in
852851
let call_kind =
853852
match call with
@@ -1037,7 +1036,7 @@ let simplify_method_call dacc apply ~callee_ty ~kind:_ ~obj ~arg_types
10371036
(Non_inlinable { escaping = true })
10381037
~env_at_use:(DA.denv dacc)
10391038
~arg_types:
1040-
(T.unknown_types_from_arity_with_subkinds
1039+
(T.unknown_types_from_arity
10411040
(Exn_continuation.arity (Apply.exn_continuation apply)))
10421041
in
10431042
let dacc =
@@ -1123,7 +1122,7 @@ let simplify_c_call ~simplify_expr dacc apply ~callee_ty ~arg_types ~down_to_up
11231122
(Non_inlinable { escaping = true })
11241123
~env_at_use:(DA.denv dacc)
11251124
~arg_types:
1126-
(T.unknown_types_from_arity_with_subkinds
1125+
(T.unknown_types_from_arity
11271126
(Exn_continuation.arity (Apply.exn_continuation apply)))
11281127
in
11291128
let dacc =

middle_end/flambda2/types/flambda2_types.mli

-2
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,6 @@ val get_alias_exn : t -> Simple.t
517517
(** For each of the kinds in an arity, create an "unknown" type. *)
518518
val unknown_types_from_arity : Flambda_arity.t -> t list
519519

520-
val unknown_types_from_arity_with_subkinds : Flambda_arity.t -> t list
521-
522520
(** For each of the kinds in an arity, create an "bottom" type. *)
523521
val bottom_types_from_arity : Flambda_arity.t -> t list
524522

middle_end/flambda2/types/grammar/more_type_creators.ml

+1-6
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,6 @@ let arity_of_list ts =
278278
Flambda_arity.create
279279
(List.map (fun ty -> Flambda_kind.With_subkind.anything (TG.kind ty)) ts)
280280

281-
let unknown_types_from_arity arity =
282-
List.map
283-
(fun kind -> unknown kind)
284-
(List.map Flambda_kind.With_subkind.kind (Flambda_arity.to_list arity))
285-
286281
let rec unknown_with_subkind ?(alloc_mode = Alloc_mode.For_types.unknown ())
287282
(kind : Flambda_kind.With_subkind.t) =
288283
(* CR mshinwell: use [alloc_mode] more *)
@@ -334,7 +329,7 @@ let rec unknown_with_subkind ?(alloc_mode = Alloc_mode.For_types.unknown ())
334329
TG.mutable_array ~element_kind:Unknown ~length:any_tagged_immediate
335330
alloc_mode
336331

337-
let unknown_types_from_arity_with_subkinds arity =
332+
let unknown_types_from_arity arity =
338333
List.map (fun kind -> unknown_with_subkind kind) (Flambda_arity.to_list arity)
339334

340335
let bottom_types_from_arity arity =

middle_end/flambda2/types/grammar/more_type_creators.mli

-3
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,5 @@ val unknown_with_subkind :
151151
(** For each of the kinds in an arity, create an "unknown" type. *)
152152
val unknown_types_from_arity : Flambda_arity.t -> Type_grammar.t list
153153

154-
val unknown_types_from_arity_with_subkinds :
155-
Flambda_arity.t -> Type_grammar.t list
156-
157154
(** For each of the kinds in an arity, create an "bottom" type. *)
158155
val bottom_types_from_arity : Flambda_arity.t -> Type_grammar.t list

0 commit comments

Comments
 (0)