From 5673d04d22334c2493efe5a2ff8108768e089be2 Mon Sep 17 00:00:00 2001 From: Léo Gourdin Date: Thu, 30 Sep 2021 15:35:21 +0200 Subject: fix issue #247 by using a BTL's ghostfield --- scheduling/BTLScheduleraux.ml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'scheduling/BTLScheduleraux.ml') diff --git a/scheduling/BTLScheduleraux.ml b/scheduling/BTLScheduleraux.ml index 0e682c4c..38bc685c 100644 --- a/scheduling/BTLScheduleraux.ml +++ b/scheduling/BTLScheduleraux.ml @@ -19,7 +19,7 @@ let flatten_blk_basics ibf = last := Some ib; [] | Bseq ((Bcond (_, _, _, _, iinfo) as ib1), ib2) -> ( - match iinfo.pcond with + match iinfo.opt_info with | Some _ -> [ ib1 ] @ traverse_blk ib2 | None -> last := Some ib; @@ -78,7 +78,8 @@ let apply_schedule bseq olast positions = let set_old = Hashtbl.find cbs_above_old n' in let set_new = Hashtbl.find cbs_above_new n' in if SI.subset set_old set_new then - bseq_new.(n') <- Bload (AST.TRAP, a, b, c, d, e) + if get_some @@ e.opt_info then + bseq_new.(n') <- Bload (AST.TRAP, a, b, c, d, e) else assert !config.has_non_trapping_loads | _ -> ()) bseq); @@ -277,7 +278,13 @@ let turn_all_loads_nontrap n ibf btl = let rec traverse_rec ib = match ib with | Bseq (ib1, ib2) -> Bseq (traverse_rec ib1, traverse_rec ib2) - | Bload (t, a, b, c, d, e) -> Bload (AST.NOTRAP, a, b, c, d, e) + | Bload (t, a, b, c, d, e) -> + let _opt_info = + match t with + | AST.TRAP -> Some true + | AST.NOTRAP -> Some false in + e.opt_info <- _opt_info; + Bload (AST.NOTRAP, a, b, c, d, e) | _ -> ib in let ib' = traverse_rec ibf.entry in @@ -304,7 +311,7 @@ let compute_liveins n ibf btl = iinfo.liveins <- Regset.union iinfo.liveins lives) tbl | Bcond (_, _, BF (Bgoto succ, _), Bnop None, iinfo) -> ( - match iinfo.pcond with + match iinfo.opt_info with | Some predb -> assert (predb = false); let lives = (get_some @@ PTree.get succ btl).input_regs in -- cgit