Skip to content
Snippets Groups Projects
Commit 7ef8a040 authored by BRUN Lelio's avatar BRUN Lelio
Browse files

avoid removing spec of `x = x` assignments

parent 011d66e3
No related branches found
No related tags found
No related merge requests found
......@@ -784,7 +784,15 @@ let rec instr_is_skip instr =
and instrs_are_skip instrs = List.for_all instr_is_skip instrs
let instr_cons instr cont = if instr_is_skip instr then cont else instr :: cont
let instr_cons instr cont =
match instr_is_skip instr, cont with
| true, [] -> [ { instr with instr_desc = MComment "" } ]
| true, i :: cont -> { i with instr_spec = i.instr_spec @ instr.instr_spec } :: cont
| false, _ -> instr :: cont
(* let instr_desc = *)
(* if instr_is_skip instr then MComment "" else instr.instr_desc in *)
(* let instr = { instr with instr_desc } in *)
(* instr :: cont *)
(* XXX: UNUSED *)
(* let rec instr_remove_skip instr cont =
......@@ -1465,7 +1473,8 @@ let optimize params prog node_schs machine_code =
let reuse_tables = Scheduling.compute_prog_reuse_table node_schs in
machine_code
|> machines_reuse_variables reuse_tables
|> machines_fusion |> machines_clean
|> machines_fusion
|> machines_clean
else machine_code
in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment