Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
profile=compact
profile=janestreet
2 changes: 1 addition & 1 deletion scripts/install_build_deps.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# Menhir is our parsing library and annoyingly its module name does not match
# its library name, so we install it manually here.
opam pin -y ocamlformat 0.8
opam pin -y ocamlformat 0.13
opam pin -y dune 1.11.4
opam install -y core_kernel.v0.11.1 menhir.20181113 ppx_deriving.4.2.1 fmt.0.8.5 yojson.1.7.0
2 changes: 1 addition & 1 deletion scripts/install_dev_deps.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
# Merlin, utop, ocp-indent, ocamlformat, and patdiff are all for developer assistance
opam install -y ocamlformat.0.8 merlin utop ocp-indent patdiff
opam install -y ocamlformat.0.13 merlin utop ocp-indent patdiff
48 changes: 28 additions & 20 deletions src/analysis_and_optimization/Dataflow_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ type reaching_defn = vexpr * label [@@deriving sexp, hash, compare]
type source_loc =
| MirNode of Location_span.t
| StartOfBlock
| TargetTerm of {term: Expr.Typed.t; assignment_label: label}
| TargetTerm of
{ term : Expr.Typed.t
; assignment_label : label
}
[@@deriving sexp]

(**
Expand All @@ -49,20 +52,20 @@ type source_loc =
there is none
*)
type 'rd_info node_info =
{ rd_sets: 'rd_info
; possible_previous: label Set.Poly.t
; rhs_set: vexpr Set.Poly.t
; controlflow: label Set.Poly.t
; loc: source_loc }
{ rd_sets : 'rd_info
; possible_previous : label Set.Poly.t
; rhs_set : vexpr Set.Poly.t
; controlflow : label Set.Poly.t
; loc : source_loc
}
[@@deriving sexp]

(**
A node_info, where the reaching definition information takes the form of an update
function that maps from the 'entry' set to the 'exit' set, where the entry set is
what's true before executing this node and the exit set is true after.
*)
type node_info_update =
(reaching_defn Set.Poly.t -> reaching_defn Set.Poly.t) node_info
type node_info_update = (reaching_defn Set.Poly.t -> reaching_defn Set.Poly.t) node_info

(**
A node_info where the reaching definition information is explicitly written as the
Expand All @@ -84,14 +87,15 @@ type node_info_fixedpoint =
* returns: A set of the return nodes that have been encountered
*)
type traversal_state =
{ label_ix: label
; node_info_map: (int, node_info_update) Map.Poly.t
; possible_previous: label Set.Poly.t
; target_terms: label Set.Poly.t
; continues: label Set.Poly.t
; breaks: label Set.Poly.t
; returns: label Set.Poly.t
; rejects: label Set.Poly.t }
{ label_ix : label
; node_info_map : (int, node_info_update) Map.Poly.t
; possible_previous : label Set.Poly.t
; target_terms : label Set.Poly.t
; continues : label Set.Poly.t
; breaks : label Set.Poly.t
; returns : label Set.Poly.t
; rejects : label Set.Poly.t
}

(** The most recently nested control flow (block start, if/then, or loop)

Expand All @@ -109,9 +113,10 @@ type cf_state = label
excluded for non-statistical dependency analysis
*)
type dataflow_graph =
{ node_info_map: (int, node_info_fixedpoint) Map.Poly.t
; possible_exits: label Set.Poly.t
; probabilistic_nodes: label Set.Poly.t }
{ node_info_map : (int, node_info_fixedpoint) Map.Poly.t
; possible_exits : label Set.Poly.t
; probabilistic_nodes : label Set.Poly.t
}
[@@deriving sexp]

(**
Expand All @@ -120,5 +125,8 @@ type dataflow_graph =
See Middle.prog for block descriptions.
*)
type prog_df_graphs =
{tdatab: dataflow_graph; modelb: dataflow_graph; gqb: dataflow_graph}
{ tdatab : dataflow_graph
; modelb : dataflow_graph
; gqb : dataflow_graph
}
[@@deriving sexp]
Loading