Commit d1d64938 authored by Léo Gourdin's avatar Léo Gourdin
Browse files

Adding miniCSE here too

parent 0b402973
......@@ -451,7 +451,7 @@ let rec write_tree exp current code' new_order =
| _ -> failwith "ExpansionOracle.write_tree: inconsistent instruction."
let expanse (sb : superblock) code pm =
debug_flag := true;
(*debug_flag := true;*)
let new_order = ref [] in
let liveins = ref sb.liveins in
let exp = ref [] in
......@@ -479,11 +479,11 @@ let expanse (sb : superblock) code pm =
was_exp := true
| Iop (Ocmp (Ccompimm (c, imm)), a1 :: nil, dest, succ) ->
debug "Iop/Ccompimm\n";
exp := expanse_condimm_int32s c a1 imm dest succ [];
exp := expanse_condimm_int32s c a1 imm dest succ [] map_consts;
was_exp := true
| Iop (Ocmp (Ccompuimm (c, imm)), a1 :: nil, dest, succ) ->
debug "Iop/Ccompuimm\n";
exp := expanse_condimm_int32u c a1 imm dest succ [];
exp := expanse_condimm_int32u c a1 imm dest succ [] map_consts;
was_exp := true
| Iop (Ocmp (Ccompl c), a1 :: a2 :: nil, dest, succ) ->
debug "Iop/Ccompl\n";
......@@ -495,11 +495,11 @@ let expanse (sb : superblock) code pm =
was_exp := true
| Iop (Ocmp (Ccomplimm (c, imm)), a1 :: nil, dest, succ) ->
debug "Iop/Ccomplimm\n";
exp := expanse_condimm_int64s c a1 imm dest succ [];
exp := expanse_condimm_int64s c a1 imm dest succ [] map_consts;
was_exp := true
| Iop (Ocmp (Ccompluimm (c, imm)), a1 :: nil, dest, succ) ->
debug "Iop/Ccompluimm\n";
exp := expanse_condimm_int64u c a1 imm dest succ [];
exp := expanse_condimm_int64u c a1 imm dest succ [] map_consts;
was_exp := true
| Iop (Ocmp (Ccompf c), f1 :: f2 :: nil, dest, succ) ->
debug "Iop/Ccompf\n";
......@@ -530,12 +530,12 @@ let expanse (sb : superblock) code pm =
was_exp := true
| Icond (Ccompimm (c, imm), a1 :: nil, succ1, succ2, info) ->
debug "Icond/Ccompimm\n";
exp := expanse_cbranchimm_int32s c a1 imm info succ1 succ2 [];
exp := expanse_cbranchimm_int32s c a1 imm info succ1 succ2 [] map_consts;
was_branch := true;
was_exp := true
| Icond (Ccompuimm (c, imm), a1 :: nil, succ1, succ2, info) ->
debug "Icond/Ccompuimm\n";
exp := expanse_cbranchimm_int32u c a1 imm info succ1 succ2 [];
exp := expanse_cbranchimm_int32u c a1 imm info succ1 succ2 [] map_consts;
was_branch := true;
was_exp := true
| Icond (Ccompl c, a1 :: a2 :: nil, succ1, succ2, info) ->
......@@ -550,12 +550,12 @@ let expanse (sb : superblock) code pm =
was_exp := true
| Icond (Ccomplimm (c, imm), a1 :: nil, succ1, succ2, info) ->
debug "Icond/Ccomplimm\n";
exp := expanse_cbranchimm_int64s c a1 imm info succ1 succ2 [];
exp := expanse_cbranchimm_int64s c a1 imm info succ1 succ2 [] map_consts;
was_branch := true;
was_exp := true
| Icond (Ccompluimm (c, imm), a1 :: nil, succ1, succ2, info) ->
debug "Icond/Ccompluimm\n";
exp := expanse_cbranchimm_int64u c a1 imm info succ1 succ2 [];
exp := expanse_cbranchimm_int64u c a1 imm info succ1 succ2 [] map_consts;
was_branch := true;
was_exp := true
| Icond (Ccompf c, f1 :: f2 :: nil, succ1, succ2, info) ->
......@@ -622,7 +622,7 @@ let expanse (sb : superblock) code pm =
sb.instructions;
sb.instructions <- Array.of_list (List.rev !new_order);
sb.liveins <- !liveins;
debug_flag := false;
(*debug_flag := false;*)
(!code', !pm')
let rec find_last_node_reg = function
......
Supports Markdown
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