Module Flambda2_kinds.Flambda_arity
Arities are used to describe the layouts of things like function and continuation parameter lists.
In Flambda 2, variables are always assigned kinds, which are at most register width (e.g. 64-bit integer machine word width, or 128-bit SIMD machine word width). Variables from Lambda which cannot be accommodated in one register, for example if they are of an unboxed product layout, are split by a process called unarization.
Despite this, `Complex arities preserve the information about any unboxed products, for later use (e.g. during Cmm translation to optimize caml_apply).
val print : Stdlib.Format.formatter -> _ Flambda2_kinds.Flambda_arity.t -> unitPrint an arity to a formatter.
module Component_for_creation : sig ... endval create :
'uc Flambda2_kinds.Flambda_arity.Component_for_creation.t list ->
'uc Flambda2_kinds.Flambda_arity.tOne component per function or continuation parameter, for example. Each component may in turn have an arity describing an unboxed product.
val create_singletons :
Flambda2_kinds.Flambda_kind.With_subkind.t list ->
[> ] Flambda2_kinds.Flambda_arity.tA shorthand for creation of arities where no parameter has an unboxed product layout.
val nullary : [> ] Flambda2_kinds.Flambda_arity.t"No parameters". (Not e.g. "one parameter of type void".)
val num_params : _ Flambda2_kinds.Flambda_arity.t -> intHow many parameters, potentially of unboxed product layout, the given arity describes.
val equal_ignoring_subkinds :
'a Flambda2_kinds.Flambda_arity.t ->
'a Flambda2_kinds.Flambda_arity.t ->
boolComparison of arities, but ignoring subkind information.
val equal_exact :
'a Flambda2_kinds.Flambda_arity.t ->
'a Flambda2_kinds.Flambda_arity.t ->
boolIt's usually a mistake to use this function, but it's needed for Compare. This is like equal_ignoring_subkinds but also insists on equality of subkind information.
val is_one_param_of_kind_value : _ Flambda2_kinds.Flambda_arity.t -> boolReturns true iff the given arity describes one parameter of kind Value. (Note that this function does not look inside unboxed products, not even ones with a single component.)
val unarize :
[ `Complex ] Flambda2_kinds.Flambda_arity.t ->
Flambda2_kinds.Flambda_kind.With_subkind.t listConvert, in a left-to-right depth-first order, an arity into a flattened list of kinds for all parameters.
val unarized_components :
[ `Unarized ] Flambda2_kinds.Flambda_arity.t ->
Flambda2_kinds.Flambda_kind.With_subkind.t listLike unarize but works on arities that are known not to contain any unboxed products.
val unarize_per_parameter :
[ `Complex ] Flambda2_kinds.Flambda_arity.t ->
Flambda2_kinds.Flambda_kind.With_subkind.t list listLike unarize but returns one list per parameter.
val unarize_t :
[ `Complex ] Flambda2_kinds.Flambda_arity.t ->
[ `Unarized ] Flambda2_kinds.Flambda_arity.tLike unarize but returns a value of type t.
val fresh_idents_unarized :
_ Flambda2_kinds.Flambda_arity.t ->
id:Ident.t ->
(Ident.t * Flambda2_kinds.Flambda_kind.With_subkind.t) listGiven an arity and an identifier, produce a list of identifiers (with corresponding kinds) whose length matches unarize t, with names derived from the given identifier.
val cardinal_unarized : _ Flambda2_kinds.Flambda_arity.t -> intThe length of the list returned by unarize.
val group_by_parameter :
[ `Complex ] Flambda2_kinds.Flambda_arity.t ->
'a list ->
'a list listval from_lambda_list :
Lambda.layout list ->
machine_width:Target_system.Machine_width.t ->
[ `Complex ] Flambda2_kinds.Flambda_arity.tTake a list of Lambda layouts, one per parameter, and form the corresponding arity.
val partially_apply :
[ `Complex ] Flambda2_kinds.Flambda_arity.t ->
num_non_unarized_params_provided:int ->
[ `Complex ] Flambda2_kinds.Flambda_arity.tRemove the first portion of an arity to correspond to a partial application (or other similar situation).
val concat :
'a Flambda2_kinds.Flambda_arity.t ->
'a Flambda2_kinds.Flambda_arity.t ->
'a Flambda2_kinds.Flambda_arity.tConcatenation of two arities, usually used to add information about more parameters to an existing arity.