Fixed problems with types
This commit is contained in:
parent
c3d47f4d4b
commit
28b9eaa203
|
@ -9,7 +9,7 @@ open Containers
|
||||||
open Printf
|
open Printf
|
||||||
|
|
||||||
let print_interference_graphs = false
|
let print_interference_graphs = false
|
||||||
let verbose_mode = false
|
let verbose_mode = true
|
||||||
let print_debug0 s =
|
let print_debug0 s =
|
||||||
if verbose_mode then
|
if verbose_mode then
|
||||||
Format.printf s
|
Format.printf s
|
||||||
|
@ -169,20 +169,26 @@ end
|
||||||
(** Helper functions to work with the multiple interference graphs *)
|
(** Helper functions to work with the multiple interference graphs *)
|
||||||
|
|
||||||
let by_ivar def f x y =
|
let by_ivar def f x y =
|
||||||
|
if World.is_optimized x then (
|
||||||
let igx, nodex = World.node_for_ivar x in
|
let igx, nodex = World.node_for_ivar x in
|
||||||
let igy, nodey = World.node_for_ivar y in
|
let igy, nodey = World.node_for_ivar y in
|
||||||
if igx == igy then
|
if igx == igy then
|
||||||
f igx nodex nodey
|
f igx nodex nodey
|
||||||
else
|
else
|
||||||
def
|
def
|
||||||
|
) else
|
||||||
|
def
|
||||||
|
|
||||||
let by_name def f x y =
|
let by_name def f x y =
|
||||||
|
if World.is_optimized (Ivar x) then (
|
||||||
let igx, nodex = World.node_for_name x in
|
let igx, nodex = World.node_for_name x in
|
||||||
let igy, nodey = World.node_for_name y in
|
let igy, nodey = World.node_for_name y in
|
||||||
if igx == igy then
|
if igx == igy then
|
||||||
f igx nodex nodey
|
f igx nodex nodey
|
||||||
else
|
else
|
||||||
def
|
def
|
||||||
|
) else
|
||||||
|
def
|
||||||
|
|
||||||
let add_interference_link_from_name = by_name () add_interference_link
|
let add_interference_link_from_name = by_name () add_interference_link
|
||||||
let add_interference_link_from_ivar = by_ivar () add_interference_link
|
let add_interference_link_from_ivar = by_ivar () add_interference_link
|
||||||
|
@ -443,7 +449,8 @@ let process_eq ({ eq_lhs = pat; eq_rhs = e } as eq) =
|
||||||
List.iter (add_interference_link_from_ivar (Ivar x)) invars;
|
List.iter (add_interference_link_from_ivar (Ivar x)) invars;
|
||||||
List.iter (add_interference_link_from_ivar (Ivar x)) pinvars
|
List.iter (add_interference_link_from_ivar (Ivar x)) pinvars
|
||||||
| Etuplepat l, Eiterator(Imapfold, { a_op = Enode _ | Efun _ }, _, pw_list, w_list, _) ->
|
| Etuplepat l, Eiterator(Imapfold, { a_op = Enode _ | Efun _ }, _, pw_list, w_list, _) ->
|
||||||
let invars, _ = Misc.split_last (InterfRead.ivars_of_extvalues w_list) in
|
let w_list, _ = Misc.split_last w_list in
|
||||||
|
let invars = InterfRead.ivars_of_extvalues w_list in
|
||||||
let pinvars = InterfRead.ivars_of_extvalues pw_list in
|
let pinvars = InterfRead.ivars_of_extvalues pw_list in
|
||||||
let outvars, acc_out = Misc.split_last (List.map InterfRead.ivar_of_pat l) in
|
let outvars, acc_out = Misc.split_last (List.map InterfRead.ivar_of_pat l) in
|
||||||
(* because of the encoding of the fold, the output is written before
|
(* because of the encoding of the fold, the output is written before
|
||||||
|
@ -458,16 +465,12 @@ let process_eq ({ eq_lhs = pat; eq_rhs = e } as eq) =
|
||||||
| Evarpat x, Efby(_, w) -> (* x = _ fby y *)
|
| Evarpat x, Efby(_, w) -> (* x = _ fby y *)
|
||||||
(match w.w_desc with
|
(match w.w_desc with
|
||||||
| Wconst _ -> ()
|
| Wconst _ -> ()
|
||||||
| _ ->
|
| _ -> add_affinity_link_from_ivar (InterfRead.ivar_of_extvalue w) (Ivar x) )
|
||||||
if World.is_optimized (Ivar x) then
|
|
||||||
add_affinity_link_from_ivar (InterfRead.ivar_of_extvalue w) (Ivar x) )
|
|
||||||
| Evarpat x, Eextvalue w ->
|
| Evarpat x, Eextvalue w ->
|
||||||
(* Add links between variables with the same value *)
|
(* Add links between variables with the same value *)
|
||||||
(match w.w_desc with
|
(match w.w_desc with
|
||||||
| Wconst _ -> ()
|
| Wconst _ -> ()
|
||||||
| _ ->
|
| _ -> add_same_value_link_from_ivar (InterfRead.ivar_of_extvalue w) (Ivar x) )
|
||||||
if World.is_optimized (Ivar x) then
|
|
||||||
add_same_value_link_from_ivar (InterfRead.ivar_of_extvalue w) (Ivar x) )
|
|
||||||
| _ -> () (* do nothing *)
|
| _ -> () (* do nothing *)
|
||||||
|
|
||||||
(** Add the special init and return equations to the dependency graph
|
(** Add the special init and return equations to the dependency graph
|
||||||
|
|
Loading…
Reference in a new issue