Ignore:
Timestamp:
Dec 6, 2011, 5:04:13 PM (9 years ago)
Author:
tranquil
Message:
  • turned to argument-less return statements for RTLabs and RTL (there was a hidden invariant, for which the arguments of return statements where equal to the f_result field of the function definition: they were useless and an optimization was breaking the compilation)
  • corrected a bug in liveness analysis I had introduced
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/RTLabs/redundancyElimination.ml

    r1580 r1589  
    118118
    119119(* used in possibly non side-effect-free statements *)
    120 let used_at_stmt stmt =
     120let used_at_stmt ret stmt =
    121121  let add_arg s = function
    122122    | Reg r -> Register.Set.add r s
     
    130130    | St_store (_, a, b, _) ->
    131131      add_arg (add_arg Register.Set.empty a) b
    132     | St_return (Some (Reg r))
    133132    | St_cond (r, _, _) -> Register.Set.singleton r
     133    | St_return ->
     134      begin match ret with
     135        | Some (r, _) -> Register.Set.singleton r
     136        | None ->  Register.Set.empty
     137      end
    134138    | _ -> Register.Set.empty
    135139
    136 let used_at g n = used_at_stmt (Label.Map.find n g)
     140let used_at ret g n = used_at_stmt ret (Label.Map.find n g)
    137141
    138142module ExprOrdered = struct
     
    378382    (g : graph)
    379383    (type_of : Register.t -> AST.sig_type)
     384    (ret : (Register.t * AST.sig_type) option)
    380385    (late : Fsing.valuation)
    381386    (lbl : Label.t)
     
    394399        Register.Set.union (Register.Set.remove r used_out) (vars_of g l)
    395400      | _ -> used_out in
    396     Register.Set.union used_out (used_at g l) in
     401    Register.Set.union used_out (used_at ret g l) in
    397402  let used = big_union f succs in
    398403
     
    406411
    407412  let graph = f_def.f_graph in
     413  let ret = f_def.f_result in
    408414
    409415  Fexprid.lfp
    410     (semantics_isolated_used graph type_of (late graph type_of delayed))
     416    (semantics_isolated_used graph type_of ret (late graph type_of delayed))
    411417
    412418(* expressions that are optimally placed at point p, without being isolated *)
Note: See TracChangeset for help on using the changeset viewer.