Summary: - docstrings - mli - split `get_control_maps`: `get_loop_head_to_source_nodes` is used both by Cost and Hoisting. If using both analyzers, it is called twice whereas it could be shared (which is done later in the stack of diffs). Reviewed By: ezgicicek Differential Revision: D14258372 fbshipit-source-id: 29addddb7master
parent
21c9227529
commit
48298f9bcc
@ -0,0 +1,32 @@
|
|||||||
|
(*
|
||||||
|
* Copyright (c) 2019-present, Facebook, Inc.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*)
|
||||||
|
|
||||||
|
open! IStd
|
||||||
|
|
||||||
|
val get_all_nodes_upwards_until : Procdesc.Node.t -> Procdesc.Node.t list -> Control.GuardNodes.t
|
||||||
|
(**
|
||||||
|
Starting from the start_nodes, find all the nodes upwards until the
|
||||||
|
target is reached, i.e picking up predecessors which have not been
|
||||||
|
already added to the found_nodes
|
||||||
|
*)
|
||||||
|
|
||||||
|
val get_loop_head_to_source_nodes : Procdesc.t -> Procdesc.Node.t list Procdesc.NodeMap.t
|
||||||
|
(**
|
||||||
|
Since there could be multiple back-edges per loop, collect all source nodes per loop head.
|
||||||
|
loop_head (target of back-edges) --> source nodes
|
||||||
|
*)
|
||||||
|
|
||||||
|
val get_control_maps :
|
||||||
|
Procdesc.Node.t list Procdesc.NodeMap.t
|
||||||
|
-> Control.loop_control_maps * Control.GuardNodes.t Procdesc.NodeMap.t
|
||||||
|
(**
|
||||||
|
Get a pair of maps (exit_map, loop_head_to_guard_map) where
|
||||||
|
exit_map : exit_node -> loop_head set (i.e. target of the back edges)
|
||||||
|
loop_head_to_guard_map : loop_head -> guard_nodes and
|
||||||
|
guard_nodes contains the nodes that may affect the looping behavior, i.e.
|
||||||
|
occur in the guard of the loop conditional.
|
||||||
|
*)
|
Loading…
Reference in new issue