From 3e6844222d39b8a76bf0af20b9cbb0dfa2e35b5a Mon Sep 17 00:00:00 2001 From: Léo Gourdin Date: Fri, 21 May 2021 21:18:59 +0200 Subject: Now supporting Bnop insertion in conditions --- scheduling/RTLtoBTLaux.ml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'scheduling/RTLtoBTLaux.ml') diff --git a/scheduling/RTLtoBTLaux.ml b/scheduling/RTLtoBTLaux.ml index 43556150..4be2b180 100644 --- a/scheduling/RTLtoBTLaux.ml +++ b/scheduling/RTLtoBTLaux.ml @@ -2,9 +2,9 @@ open Maps open RTL open BTL open Registers -open DebugPrint open PrintBTL open AuxTools +open DebugPrint open BTLaux let undef_node = -1 @@ -20,13 +20,13 @@ let encaps_final inst osucc = | BF _ | Bcond _ -> inst | _ -> Bseq (inst, BF (Bgoto (get_some @@ osucc), def_iinfo)) -let translate_inst iinfo inst is_final = +let translate_inst (iinfo: BTL.inst_info) inst is_final = let osucc = ref None in let btli = match inst with | Inop s -> osucc := Some s; - Bnop iinfo + Bnop (Some iinfo) | Iop (op, lr, rd, s) -> osucc := Some s; Bop (op, lr, rd, iinfo) @@ -80,12 +80,13 @@ let translate_function code entry join_points = assert (s = ifnot); next_nodes := !next_nodes @ non_predicted_successors inst psucc; iinfo.pcond <- info; + Bseq ( Bcond ( cond, lr, BF (Bgoto ifso, def_iinfo), - build_btl_block s, - iinfo ) + Bnop None, + iinfo ), build_btl_block s) | _ -> Bseq (translate_inst iinfo inst false, build_btl_block s)) | None -> debug "BLOCK END.\n"; -- cgit