[call-graph scheduling] fix bug in node removal

Summary:
The order was wrong: the map from procnames to node-ids was cleaned first, but to clean the map from node-ids to nodes, we need the id and we have already removed it.

The symptom was that effectively no new leaves are created by "removing" a node, so the call graph scheduler quickly devolves to the file-based one.

Reviewed By: skcho

Differential Revision: D18448209

fbshipit-source-id: f272a8112
master
Nikos Gorogiannis 5 years ago committed by Facebook Github Bot
parent e7874c74f4
commit 8f8050ba3f

@ -71,8 +71,8 @@ let n_procs {node_map} = NodeMap.length node_map
let node_of_procname g pname = id_of_procname g pname |> Option.bind ~f:(node_of_id g) let node_of_procname g pname = id_of_procname g pname |> Option.bind ~f:(node_of_id g)
let remove (g : t) pname = let remove (g : t) pname =
IdMap.remove g.id_map pname ; id_of_procname g pname |> Option.iter ~f:(NodeMap.remove g.node_map) ;
id_of_procname g pname |> Option.iter ~f:(NodeMap.remove g.node_map) IdMap.remove g.id_map pname
let get_or_set_id ({id_map} as graph) procname = let get_or_set_id ({id_map} as graph) procname =

Loading…
Cancel
Save