Commit bde193f5 authored by Andrei Paskevich's avatar Andrei Paskevich
Browse files

Ity: tentative merge of refresh effects

parent fad54f38
......@@ -235,9 +235,17 @@ let ity_r_any pr ity =
let ity_r_occurs reg ity =
let rec check r = ity_equal r reg ||
let _, tl, rl, _ = open_region r in
let _,tl,rl,_ = open_region r in
List.exists (ity_r_any check) tl ||
List.exists (ity_r_any check) rl in
List.exists check rl in
ity_r_any check ity
let ity_r_stale reg sreg ity =
let rec check r = ity_equal r reg ||
if Sreg.mem r sreg then false else
let _,tl,rl,_ = open_region r in
List.exists (ity_r_any check) tl ||
List.exists check rl in
ity_r_any check ity
let ity_immutable ity = not ity.ity_pure
......@@ -650,6 +658,11 @@ let freeze_of_writes wr =
List.fold_left2 freeze_unhit frz s.its_regions rl in
Mreg.fold freeze_of_write wr Mtv.empty
let merge_covers reg sreg1 sreg2 =
Sreg.union
(Sreg.filter (fun r -> not (ity_r_stale reg sreg1 r)) sreg2)
(Sreg.filter (fun r -> not (ity_r_stale reg sreg2 r)) sreg1)
let eff_assign e asl =
let seen,e = List.fold_left (fun (seen,e) (r,f,ity) ->
begin match r.ity_node with
......
......@@ -146,6 +146,7 @@ val ity_r_all : (region -> bool) -> ity -> bool
val ity_r_any : (region -> bool) -> ity -> bool
val ity_r_occurs : region -> ity -> bool
val ity_r_stale : region -> Sreg.t -> ity -> bool
val ity_closed : ity -> bool
val ity_immutable : ity -> bool
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment