let combinePredecessors
(s: stmt)
~old:({
deps_table = old_table} as old)
({
deps_table = new_table } as new_) =
let new_ = computeFirstPredecessor s new_ in
let changed = ref false in
let merged =
Stmt.Map.fold
(fun k v acc ->
try
let current_val = Stmt.Map.find k acc.additional_deps_table in
if Zone.is_included v current_val then
acc
else
begin
changed := true;
{acc with
additional_deps_table =
Stmt.Map.add
k
(Zone.join current_val v)
acc.additional_deps_table;
additional_deps = Zone.join v acc.additional_deps}
end
with Not_found ->
changed := true;
{acc with
additional_deps_table =
Stmt.Map.add
k
v
acc.additional_deps_table;
additional_deps = Zone.join v acc.additional_deps
}
)
new_.additional_deps_table
old
in
let result = Lmap_bitwise.From_Model.join old_table new_table
in
if (not !changed) && Lmap_bitwise.From_Model.is_included result old_table
then None
else
Some ({merged with deps_table = result })