Add warning headers to flambda files
parent
fb35dc8fb4
commit
0e8ed08a9d
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module Env : sig
|
||||
type t
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Construct export information, for emission into .cmx files, from an
|
||||
Flambda program. *)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type result = {
|
||||
function_offsets : int Closure_id.Map.t;
|
||||
free_variable_offsets : int Var_within_closure.Map.t;
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Assign numerical offsets, within closure blocks, for code pointers and
|
||||
environment entries. *)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type value_string_contents =
|
||||
| Contents of string
|
||||
| Unknown_or_mutable
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Exported information (that is to say, information written into a .cmx
|
||||
file) about a compilation unit. *)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
let rename_id_state = Export_id.Tbl.create 100
|
||||
|
||||
(* Rename export identifiers' compilation units to denote that they now
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Transformations on export information that are only used for the
|
||||
building of packs. *)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type for_one_or_more_units = {
|
||||
fun_offset_table : int Closure_id.Map.t;
|
||||
fv_offset_table : int Var_within_closure.Map.t;
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type result = {
|
||||
expr : Clambda.ulambda;
|
||||
preallocated_blocks : Clambda.preallocated_block list;
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module A = Simple_value_approx
|
||||
|
||||
let import_set_of_closures =
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Create simple value approximations from the export information in
|
||||
.cmx files. *)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-30-40-41-42"]
|
||||
|
||||
(* We say that an [Ident.t] is "linear" iff:
|
||||
(a) it is used exactly once;
|
||||
(b) it is never assigned to (using [Uassign]).
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type allocation_point =
|
||||
| Symbol of Symbol.t
|
||||
| Variable of Variable.t
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type allocation_point =
|
||||
| Symbol of Symbol.t
|
||||
| Variable of Variable.t
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type t =
|
||||
| Float of float
|
||||
| Int32 of int32
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Constants that are always allocated (possibly statically). Blocks
|
||||
are not included here since they are always encoded using
|
||||
[Prim (Pmakeblock, ...)]. *)
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module A = Simple_value_approx
|
||||
module E = Inline_and_simplify_aux.Env
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
val run :
|
||||
env:Inline_and_simplify_aux.Env.t ->
|
||||
set_of_closures:Flambda.set_of_closures ->
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Knowledge that the middle end needs about the backend. *)
|
||||
|
||||
module type S = sig
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
include Variable
|
||||
|
||||
let wrap t = t
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
include Identifiable.S
|
||||
|
||||
val wrap : Variable.t -> t
|
||||
|
|
|
@ -14,4 +14,6 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
include Closure_element
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** CR-someday lwhite: "Closure_id" is quite a generic name. I wonder wether something
|
||||
like "Closure_label" would better capture that it is the label of a projection. *)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type t = {
|
||||
id : Ident.t;
|
||||
linkage_name : Linkage_name.t;
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
include Identifiable.S
|
||||
|
||||
(* The [Ident.t] must be persistent. This function raises an exception
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module Id : Id_types.Id = Id_types.Id (struct end)
|
||||
module Unit_id = Id_types.UnitId (Id) (Compilation_unit)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(* Keys representing value descriptions that may be written into
|
||||
intermediate files and loaded by a dependent compilation unit.
|
||||
These keys are used to ensure maximal sharing of value descriptions,
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module type BaseId = sig
|
||||
type t
|
||||
val equal : t -> t -> bool
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(* CR-soon mshinwell: This module should be removed. *)
|
||||
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type t = string
|
||||
|
||||
include Identifiable.Make (struct
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
include Identifiable.S
|
||||
|
||||
val create : string -> t
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type t = {
|
||||
compilation_unit : Compilation_unit.t;
|
||||
ident : Ident.t;
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
include Identifiable.S
|
||||
|
||||
val create : ?current_compilation_unit:Compilation_unit.t -> string -> t
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module Id : Id_types.Id = Id_types.Id (struct end)
|
||||
module Unit_id = Id_types.UnitId (Id) (Compilation_unit)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** An identifier, unique across the whole program, that identifies a set
|
||||
of a closures (viz. [Set_of_closures]). *)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
include Numbers.Int
|
||||
|
||||
let create () = Lambda.next_raise_count ()
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** An identifier that is used to label static exceptions. Its
|
||||
uniqueness properties are unspecified. *)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type t = {
|
||||
compilation_unit : Compilation_unit.t;
|
||||
label : Linkage_name.t;
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** A symbol identifies a constant provided by either:
|
||||
- another compilation unit; or
|
||||
- a top-level module.
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type t = int
|
||||
|
||||
include Identifiable.Make (Numbers.Int)
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Tags on runtime boxed values. *)
|
||||
|
||||
include Identifiable.S
|
||||
|
|
|
@ -14,4 +14,6 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
include Closure_element
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** An identifier, unique across the whole program, that identifies a
|
||||
particular variable within a particular closure. Only
|
||||
[Project_var], and not [Var], nodes are tagged with these
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type t = {
|
||||
compilation_unit : Compilation_unit.t;
|
||||
name : string;
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** [Variable.t] is the equivalent of a non-persistent [Ident.t] in
|
||||
the [Flambda] tree. It wraps an [Ident.t] together with its source
|
||||
[compilation_unit]. As such, it is unique within a whole program,
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module Env = Closure_conversion_aux.Env
|
||||
module Function_decls = Closure_conversion_aux.Function_decls
|
||||
module Function_decl = Function_decls.Function_decl
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Generation of [Flambda] intermediate language code from [Lambda] code
|
||||
by performing a form of closure conversion.
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module IdentSet = Lambda.IdentSet
|
||||
|
||||
module Env = struct
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Environments and auxiliary structures used during closure conversion. *)
|
||||
|
||||
(** Used to remember which [Variable.t] values correspond to which
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
let no_effects_prim (prim : Lambda.primitive) =
|
||||
match Semantics_of_primitives.for_primitive prim with
|
||||
| (No_effects | Only_generative_effects), (No_coeffects | Has_coeffects) ->
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Simple side effect analysis. *)
|
||||
|
||||
(* CR-someday pchambart: Replace by call to [Purity] module.
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
let in_function_declarations (function_decls : Flambda.function_declarations)
|
||||
~backend =
|
||||
let module VCC = Strongly_connected_components.Make (Variable) in
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** "Recursive functions" are those functions [f] that might call either:
|
||||
- themselves, or
|
||||
- another function that in turn might call [f].
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type call_kind =
|
||||
| Indirect
|
||||
| Direct of Closure_id.t
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Intermediate language used for tree-based analysis and optimization. *)
|
||||
|
||||
(** Whether the callee in a function application is known at compile time. *)
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-30-40-41-42"]
|
||||
|
||||
type flambda_kind =
|
||||
| Normal
|
||||
| Lifted
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type flambda_kind =
|
||||
| Normal
|
||||
| Lifted
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
let apply_on_subexpressions f f_named (flam : Flambda.t) =
|
||||
match flam with
|
||||
| Var _ | Apply _ | Assign _ | Send _ | Proved_unreachable
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(* CR-soon mshinwell: we need to document whether these iterators follow any
|
||||
particular order. *)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
let find_declaration cf ({ funs } : Flambda.function_declarations) =
|
||||
Variable.Map.find (Closure_id.unwrap cf) funs
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Utility functions for the Flambda intermediate language. *)
|
||||
|
||||
(** Access functions *)
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type tbl = {
|
||||
sb_var : Variable.t Variable.Map.t;
|
||||
sb_mutable_var : Mutable_variable.t Mutable_variable.Map.t;
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Freshening of various identifiers. *)
|
||||
|
||||
(** A table used for freshening variables and static exception identifiers. *)
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(* This cannot be done in a single simple pass due to expressions like:
|
||||
|
||||
let rec ... =
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type result
|
||||
|
||||
(** [inconstants_on_program] finds those variables and set-of-closures identifiers that
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
let constant_field (expr:Flambda.t)
|
||||
: Flambda.constant_defining_value_block_field option =
|
||||
match expr with
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Transform Initialize_symbol with only constant fields to
|
||||
let_symbol construction. *)
|
||||
val run : Flambda.program -> Flambda.program
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module A = Simple_value_approx
|
||||
module B = Inlining_cost.Benefit
|
||||
module E = Inline_and_simplify_aux.Env
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Simplification of Flambda programs combined with function inlining:
|
||||
for the most part a beta-reduction pass.
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module Env = struct
|
||||
type scope = Current | Outer
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Environments and result structures used during inlining and
|
||||
simplification. (See inline_and_simplify.ml.) *)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(* Simple approximation of the space cost of a primitive. *)
|
||||
|
||||
let prim_size (prim : Lambda.primitive) args =
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Measurement of the cost (including cost in space) of Flambda terms
|
||||
in the context of inlining. *)
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module A = Simple_value_approx
|
||||
module E = Inline_and_simplify_aux.Env
|
||||
module R = Inline_and_simplify_aux.Result
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(* CR mshinwell: Add the new inlining heuristic documentation here. *)
|
||||
|
||||
(** Try to inline a full application of a known function, guided by various
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(* CR-someday mshinwell: name of this source file could now be improved *)
|
||||
|
||||
type 'a by_copying_function_body =
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
let _vim_trailer = "vim:fdm=expr:filetype=plain:\
|
||||
foldexpr=getline(v\\:lnum)=~'^\\\\s*$'&&getline(v\\:lnum+1)=~'\\\\S'?'<1'\\:1"
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module Closure_stack : sig
|
||||
type t
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module Wsb = Inlining_cost.Whether_sufficient_benefit
|
||||
|
||||
let print_stars ppf n =
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(* Types used for producing statistics about inlining. *)
|
||||
|
||||
module Inlined : sig
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module A = Simple_value_approx
|
||||
module B = Inlining_cost.Benefit
|
||||
module E = Inline_and_simplify_aux.Env
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Source code transformations used during inlining. *)
|
||||
|
||||
(** Inline a function by substituting its body (which may be subject to
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(* CR-someday pchambart to pchambart: in fact partial application doesn't
|
||||
work because there are no 'known' partial application left: they are
|
||||
converted to applications new partial function declaration.
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(* [invariant_params_in_recursion] calculates the set of parameters whose
|
||||
values are known not to change during the execution of a recursive
|
||||
function. As such, occurrences of the parameters may always be replaced
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
module A = Simple_value_approx
|
||||
module C = Inlining_cost
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type lifter = Flambda.program -> Flambda.program
|
||||
|
||||
(** Lift [let] bindings to attempt to increase the length of scopes, as an
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
let rec tail_variable : Flambda.t -> Variable.t option = function
|
||||
| Var v -> Some v
|
||||
| Let_rec (_, e)
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(* CR mshinwell: check comment is up to date *)
|
||||
(** The aim of this pass is to assign symbols to values known to be
|
||||
constant (in other words, whose values we know at compile time), with
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
type ('a, 'b) kind =
|
||||
| Initialisation of (Symbol.t * Tag.t * Flambda.t list)
|
||||
| Effect of 'b
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Lift toplevel [Let]-expressions to Flambda [program] constructions such
|
||||
that the results of evaluation of such expressions may be accessed
|
||||
directly, through symbols, rather than through closures. The
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
let _dump_function_sizes flam ~backend =
|
||||
let module Backend = (val backend : Backend_intf.S) in
|
||||
let than = max_int in
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(* Translate Lambda code to Flambda code and then optimize it. *)
|
||||
|
||||
val middle_end
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
let rename_var var =
|
||||
Mutable_variable.create
|
||||
(Variable.unique_name var)
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Transform [let]-bound references into variables. *)
|
||||
|
||||
val eliminate_ref
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
let pass_name = "remove-unused-arguments"
|
||||
let () = Clflags.all_passes := pass_name :: !Clflags.all_passes
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Introduce a stub function to avoid depending on unused arguments.
|
||||
|
||||
For instance, it turns
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** A variable in a closure can either be used by the closure itself
|
||||
or by an inlined version of the function. *)
|
||||
let remove_unused_closure_variables program =
|
||||
|
|
|
@ -14,5 +14,7 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
(** Eliminate variables bound by closures that are not required. *)
|
||||
val remove_unused_closure_variables : Flambda.program -> Flambda.program
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
[@@@ocaml.warning "+a-4-9-30-40-41-42"]
|
||||
|
||||
let dependency (expr:Flambda.t) = Flambda.free_symbols expr
|
||||
|
||||
(* CR-soon pchambart: copied from lift_constant. Needs remerging *)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue