aboutsummaryrefslogtreecommitdiffstats
path: root/kvx
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-07-08 09:31:10 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-07-08 09:31:10 +0200
commitd37a9db8edb9c38c79940d9a3d647430a4c4d3e5 (patch)
tree0e1a369573aa44529c0bdfa436103377b85a42ac /kvx
parent88c5e2a6a06e045e13f49c34183f0a59136775f9 (diff)
downloadcompcert-kvx-d37a9db8edb9c38c79940d9a3d647430a4c4d3e5.tar.gz
compcert-kvx-d37a9db8edb9c38c79940d9a3d647430a4c4d3e5.zip
use a command-line option
Diffstat (limited to 'kvx')
-rw-r--r--kvx/lib/RTLpathScheduleraux.ml39
1 files changed, 21 insertions, 18 deletions
diff --git a/kvx/lib/RTLpathScheduleraux.ml b/kvx/lib/RTLpathScheduleraux.ml
index 3008543c..32fb2c2a 100644
--- a/kvx/lib/RTLpathScheduleraux.ml
+++ b/kvx/lib/RTLpathScheduleraux.ml
@@ -95,24 +95,27 @@ end
(* TODO David *)
let schedule_superblock sb code =
- let old_flag = !debug_flag in
- debug_flag := true;
- print_endline "ORIGINAL SUPERBLOCK";
- print_superblock sb code;
- debug_flag := old_flag;
- match PrepassSchedulingOracle.schedule_sequence
- (Array.map (fun i ->
- match PTree.get i code with Some ii -> ii | None -> failwith "RTLpathScheduleraux.schedule_superblock")
- sb.instructions) with
- | None -> sb.instructions
- | Some order ->
- let ins' = Array.map (fun i -> sb.instructions.(i)) order in
- Printf.printf "REORDERED SUPERBLOCK %d\n" (Array.length ins');
- debug_flag := true;
- print_instructions (Array.to_list ins') code;
- debug_flag := old_flag;
- (*sb.instructions; *)
- ins';;
+ if not !Clflags.option_fprepass
+ then sb.instructions
+ else
+ let old_flag = !debug_flag in
+ debug_flag := true;
+ print_endline "ORIGINAL SUPERBLOCK";
+ print_superblock sb code;
+ debug_flag := old_flag;
+ match PrepassSchedulingOracle.schedule_sequence
+ (Array.map (fun i ->
+ match PTree.get i code with Some ii -> ii | None -> failwith "RTLpathScheduleraux.schedule_superblock")
+ sb.instructions) with
+ | None -> sb.instructions
+ | Some order ->
+ let ins' = Array.map (fun i -> sb.instructions.(i)) order in
+ Printf.printf "REORDERED SUPERBLOCK %d\n" (Array.length ins');
+ debug_flag := true;
+ print_instructions (Array.to_list ins') code;
+ debug_flag := old_flag;
+ (*sb.instructions; *)
+ ins';;
(* stub2: reverse function *)
(*