Ignore:
Timestamp:
Oct 19, 2011, 5:59:50 PM (10 years ago)
Author:
tranquil
Message:

first draft of peeling optimization:

  • a framework for heuristics has been set up, but peeling is always applied at the moment
  • cost mapping not touched yet
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051-indexed-labels-branch/src/cminor/cminorToRTLabs.ml

    r1392 r1421  
    269269    (rtlabs_fun : RTLabs.internal_function)
    270270    (lenv       : local_env)
    271     (exits      : Label.t list)
     271(*    (exits      : Label.t list) *)
    272272    (stmt       : Cminor.statement)
    273273    : RTLabs.internal_function =
     
    321321
    322322    | Cminor.St_seq (s1, s2) ->
    323       let rtlabs_fun = translate_stmt rtlabs_fun lenv exits s2 in
    324       translate_stmt rtlabs_fun lenv exits s1
     323      let rtlabs_fun = translate_stmt rtlabs_fun lenv s2 in
     324      translate_stmt rtlabs_fun lenv (* exits *) s1
    325325
    326326    | Cminor.St_ifthenelse (e, s1, s2) ->
    327327      let old_entry = rtlabs_fun.RTLabs.f_entry in
    328       let rtlabs_fun = translate_stmt rtlabs_fun lenv exits s2 in
     328      let rtlabs_fun = translate_stmt rtlabs_fun lenv s2 in
    329329      let lbl_false = rtlabs_fun.RTLabs.f_entry in
    330330      let rtlabs_fun = change_entry rtlabs_fun old_entry in
    331       let rtlabs_fun = translate_stmt rtlabs_fun lenv exits s1 in
     331      let rtlabs_fun = translate_stmt rtlabs_fun lenv s1 in
    332332      let lbl_true = rtlabs_fun.RTLabs.f_entry in
    333333      translate_branch rtlabs_fun lenv e lbl_true lbl_false
     
    362362
    363363    | Cminor.St_label (lbl, s) ->
    364       let rtlabs_fun = translate_stmt rtlabs_fun lenv exits s in
     364      let rtlabs_fun = translate_stmt rtlabs_fun lenv s in
    365365      let old_entry = rtlabs_fun.RTLabs.f_entry in
    366366      add_graph rtlabs_fun lbl (RTLabs.St_skip old_entry)
    367367
    368368    | Cminor.St_cost (lbl, s) ->
    369       let rtlabs_fun = translate_stmt rtlabs_fun lenv exits s in
     369      let rtlabs_fun = translate_stmt rtlabs_fun lenv s in
    370370      let old_entry = rtlabs_fun.RTLabs.f_entry in
    371371      generate rtlabs_fun (RTLabs.St_cost (lbl, old_entry))
    372372
    373373    | Cminor.St_ind_0 (i, s) ->
    374       let rtlabs_fun = translate_stmt rtlabs_fun lenv exits s in
     374      let rtlabs_fun = translate_stmt rtlabs_fun lenv s in
    375375      let old_entry = rtlabs_fun.RTLabs.f_entry in
    376376      generate rtlabs_fun (RTLabs.St_ind_0 (i, old_entry))
    377377
    378378    | Cminor.St_ind_inc (i, s) ->
    379       let rtlabs_fun = translate_stmt rtlabs_fun lenv exits s in
     379      let rtlabs_fun = translate_stmt rtlabs_fun lenv s in
    380380      let old_entry = rtlabs_fun.RTLabs.f_entry in
    381381      generate rtlabs_fun (RTLabs.St_ind_inc (i, old_entry))
     
    456456
    457457  (* Complete the graph *)
    458   translate_stmt rtlabs_fun lenv [] f_def.Cminor.f_body
     458  translate_stmt rtlabs_fun lenv f_def.Cminor.f_body
    459459
    460460
Note: See TracChangeset for help on using the changeset viewer.