From ca78138a8a81af44a36e339ad1ecf86ca3862e50 Mon Sep 17 00:00:00 2001 From: Léo Gourdin Date: Tue, 23 Mar 2021 09:50:55 +0100 Subject: Bugfix liveness --- riscV/ExpansionOracle.ml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'riscV') diff --git a/riscV/ExpansionOracle.ml b/riscV/ExpansionOracle.ml index 81c369f7..27a36283 100644 --- a/riscV/ExpansionOracle.ml +++ b/riscV/ExpansionOracle.ml @@ -628,19 +628,15 @@ let expanse (sb : superblock) code pm = was_exp := true | _ -> ()); if !was_exp then ( - (*node := !node + 1;*) - (*(if !was_branch then - let lives = PTree.get n !liveins in - match lives with - | Some lives -> - let new_branch_pc = - Camlcoq.P.of_int (!node - (List.length !exp - 1)) - in - liveins := PTree.set new_branch_pc lives !liveins; - liveins := PTree.remove n !liveins - | _ -> ());*) + (if !was_branch && List.length !exp > 1 then + let lives = PTree.get n !liveins in + match lives with + | Some lives -> + let new_branch_pc = n2p () in + liveins := PTree.set new_branch_pc lives !liveins; + liveins := PTree.remove n !liveins + | _ -> ()); write_pathmap sb.instructions.(0) (List.length !exp - 1) pm'; - (*write_initial_node n code' new_order;*) write_tree !exp n !node code' new_order) else new_order := n :: !new_order) sb.instructions; -- cgit