Project

General

Profile

Revision 5f31b494 src/liveness.ml

View differences:

src/liveness.ml
192 192
  try
193 193
    let disjoint_live = Disjunction.CISet.inter disjoint live in
194 194
    let reuse = Disjunction.CISet.max_elt disjoint_live in
195
    let reuse' = Hashtbl.find ctx.policy reuse.var_id in
195 196
    begin
196 197
      IdentDepGraph.add_edge ctx.dep_graph var.var_id reuse.var_id;
197
      Hashtbl.add ctx.policy var.var_id (Hashtbl.find ctx.policy reuse.var_id);
198
      if reuse != reuse' then IdentDepGraph.add_edge ctx.dep_graph reuse.var_id reuse'.var_id;
199
      Hashtbl.add ctx.policy var.var_id reuse';
198 200
      ctx.evaluated <- Disjunction.CISet.add var ctx.evaluated;
199 201
      (*Format.eprintf "%s reused by live@." var.var_id;*)
200 202
    end
......
202 204
  try
203 205
    let dead = Disjunction.CISet.filter (fun v -> is_graph_root v.var_id ctx.dep_graph) quasi_dead in
204 206
    let reuse = Disjunction.CISet.choose dead in
207
    let reuse' = Hashtbl.find ctx.policy reuse.var_id in
205 208
    begin
206 209
      IdentDepGraph.add_edge ctx.dep_graph var.var_id reuse.var_id;
207
      Hashtbl.add ctx.policy var.var_id (Hashtbl.find ctx.policy reuse.var_id);
210
      if reuse != reuse' then IdentDepGraph.add_edge ctx.dep_graph reuse.var_id reuse'.var_id;
211
      Hashtbl.add ctx.policy var.var_id reuse';
208 212
      ctx.evaluated <- Disjunction.CISet.add var ctx.evaluated;
209 213
      (*Format.eprintf "%s reused by dead %a@." var.var_id Disjunction.pp_ciset dead;*)
210 214
    end

Also available in: Unified diff