From ee2112a9bacc246e0434a19fc93aab335fd56ddd Mon Sep 17 00:00:00 2001 From: "nicolas.nardino" Date: Mon, 19 Jul 2021 18:09:27 +0200 Subject: Fix scheduling fails (forgot a case) --- scheduling/InstructionScheduler.ml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'scheduling/InstructionScheduler.ml') diff --git a/scheduling/InstructionScheduler.ml b/scheduling/InstructionScheduler.ml index 3e82336b..9c5c674d 100644 --- a/scheduling/InstructionScheduler.ml +++ b/scheduling/InstructionScheduler.ml @@ -349,13 +349,14 @@ let _ = fun x -> priority_list_scheduler INSTRUCTION_ORDER x;; (* A scheduler sensitive to register pressure *) let reg_pres_scheduler (problem : problem) : solution option = - DebugPrint.debug_flag := true; + (* DebugPrint.debug_flag := true; *) let nr_instructions = get_nr_instructions problem in - (* if !Clflags.option_debug_compcert > 6 then *) - DebugPrint.debug "\nSCHEDULING_SUPERBLOCK %d\n" nr_instructions; - + if !Clflags.option_debug_compcert > 6 then + (Printf.eprintf "\nSCHEDULING_SUPERBLOCK %d\n" nr_instructions; + flush stderr); + let successors = get_successors problem and predecessors = get_predecessors problem and times = Array.make (nr_instructions+1) (-1) in @@ -524,7 +525,8 @@ let reg_pres_scheduler (problem : problem) : solution option = then result := ins ) ready; if !result <> -1 then - vector_subtract usages.(!result) current_resources) + vector_subtract usages.(!result) current_resources; + incr cnt) else (incr cnt) ); @@ -550,7 +552,8 @@ let reg_pres_scheduler (problem : problem) : solution option = | i -> (assert(times.(i) < 0); (DebugPrint.debug "INSTR ISSUED: %d\n" i; if !csr_b && !Clflags.option_debug_compcert > 6 then - DebugPrint.debug "REGPRES: high pres class %d\n" i; + (Printf.eprintf "REGPRES: high pres class %d\n" i; + flush stderr); csr_b := false; (* if !Clflags.option_regpres_wait_window then *) cnt := 0; @@ -601,11 +604,11 @@ let reg_pres_scheduler (problem : problem) : solution option = if target_time > !final_time then final_time := target_time) predecessors.(nr_instructions); times.(nr_instructions) <- !final_time; - DebugPrint.debug_flag := false; + (* DebugPrint.debug_flag := false; *) Some times with Exit -> DebugPrint.debug "reg_pres_sched failed\n"; - DebugPrint.debug_flag := false; + (* DebugPrint.debug_flag := false; *) None ;; -- cgit