@@ -69,7 +69,7 @@ let definitions prog =
6969 match i with
7070 | Let (x , e ) -> set_def x (Expr e)
7171 | Assign (x , _ ) -> set_def x Param
72- | Set_field (_ , _ , _ ) | Offset_ref (_ , _ ) | Array_set (_ , _ , _ ) -> () )
72+ | Set_field (_ , _ , _ , _ ) | Offset_ref (_ , _ ) | Array_set (_ , _ , _ ) -> () )
7373 block.body)
7474 prog.blocks;
7575 defs
@@ -128,7 +128,7 @@ let usages prog (global_info : Global_flow.info) :
128128 ~f: (fun a -> if variable_may_escape a global_info then add_use Compute x a)
129129 args
130130 | Block (_ , vars , _ , _ ) -> Array. iter ~f: (add_use Compute x) vars
131- | Field (z , _ ) -> add_use Compute x z
131+ | Field (z , _ , _ ) -> add_use Compute x z
132132 | Constant _ -> ()
133133 | Special _ -> ()
134134 | Closure (_ , cont ) -> add_cont_deps cont
@@ -149,7 +149,7 @@ let usages prog (global_info : Global_flow.info) :
149149 | Let (x , e ) -> add_expr_uses x e
150150 (* For assignment, propagate liveness from new to old variable like a block parameter *)
151151 | Assign (x , y ) -> add_use Propagate x y
152- | Set_field (_ , _ , _ ) | Offset_ref (_ , _ ) | Array_set (_ , _ , _ ) -> () )
152+ | Set_field (_ , _ , _ , _ ) | Offset_ref (_ , _ ) | Array_set (_ , _ , _ ) -> () )
153153 block.body;
154154 (* Add uses from block branch *)
155155 match fst block.branch with
@@ -175,7 +175,7 @@ let expr_vars e =
175175 List. fold_left ~f: (fun acc x -> Var.Set. add x acc) ~init: vars args
176176 | Block (_ , params , _ , _ ) ->
177177 Array. fold_left ~f: (fun acc x -> Var.Set. add x acc) ~init: vars params
178- | Field (z , _ ) -> Var.Set. add z vars
178+ | Field (z , _ , _ ) -> Var.Set. add z vars
179179 | Prim (_ , args ) ->
180180 List. fold_left
181181 ~f: (fun acc v ->
@@ -225,14 +225,14 @@ let liveness prog pure_funs (global_info : Global_flow.info) =
225225 ~f: (fun x -> if variable_may_escape x global_info then add_top x)
226226 args
227227 | Block (_, _, _, _)
228- | Field (_, _)
228+ | Field (_, _, _ )
229229 | Closure (_, _)
230230 | Constant _
231231 | Prim (_, _)
232232 | Special _ ->
233233 let vars = expr_vars e in
234234 Var.Set. iter add_top vars)
235- | Set_field (x , i , y ) ->
235+ | Set_field (x , i , _ , y ) ->
236236 add_live_field x i;
237237 add_top y
238238 | Array_set (x , y , z ) ->
@@ -294,12 +294,12 @@ let propagate uses defs live_vars live_table x =
294294 if Var. equal v x && IntSet. mem i fields then found := true )
295295 vars;
296296 if ! found then Top else Dead
297- | Expr (Field (_ , i )) -> Live (IntSet. singleton i)
297+ | Expr (Field (_ , i , _ )) -> Live (IntSet. singleton i)
298298 | _ -> Top )
299299 (* If y is top and y is a field access, x depends only on that field *)
300300 | Top -> (
301301 match Var.Tbl. get defs y with
302- | Expr (Field (_ , i )) -> Live (IntSet. singleton i)
302+ | Expr (Field (_ , i , _ )) -> Live (IntSet. singleton i)
303303 | _ -> Top ))
304304 (* If x is used as an argument for parameter y, then contribution is liveness of y *)
305305 | Propagate -> Var.Tbl. get live_table y
@@ -358,8 +358,9 @@ let zero prog sentinal live_table =
358358 | Apply ap ->
359359 let args = List. map ~f: zero_var ap.args in
360360 Let (x, Apply { ap with args })
361- | Field (_ , _ ) | Closure (_ , _ ) | Constant _ | Prim (_ , _ ) | Special _ -> instr)
362- | Assign (_ , _ ) | Set_field (_ , _ , _ ) | Offset_ref (_ , _ ) | Array_set (_ , _ , _ ) ->
361+ | Field (_ , _ , _ ) | Closure (_ , _ ) | Constant _ | Prim (_ , _ ) | Special _ -> instr
362+ )
363+ | Assign (_ , _ ) | Set_field (_ , _ , _ , _ ) | Offset_ref (_ , _ ) | Array_set (_ , _ , _ ) ->
363364 instr
364365 in
365366 let zero_block block =
0 commit comments