aboutsummaryrefslogtreecommitdiffstats
path: root/backend/Duplicateaux.ml
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2020-01-15 11:36:28 +0100
committerCyril SIX <cyril.six@kalray.eu>2020-01-15 11:36:28 +0100
commit675b6539607f387d43b8d7e04de31292b4246a1b (patch)
treedb2fca0a2ca1e8994fc2bbc49a5e8553859edc66 /backend/Duplicateaux.ml
parent05dca79f702bc46246d0314c33445cb11ef59223 (diff)
downloadcompcert-kvx-675b6539607f387d43b8d7e04de31292b4246a1b.tar.gz
compcert-kvx-675b6539607f387d43b8d7e04de31292b4246a1b.zip
Adding more debug elements
Diffstat (limited to 'backend/Duplicateaux.ml')
-rw-r--r--backend/Duplicateaux.ml10
1 files changed, 9 insertions, 1 deletions
diff --git a/backend/Duplicateaux.ml b/backend/Duplicateaux.ml
index 1a41ed79..ec99027a 100644
--- a/backend/Duplicateaux.ml
+++ b/backend/Duplicateaux.ml
@@ -252,16 +252,24 @@ let get_directions code entrypoint =
List.iter (fun n ->
match (get_some @@ PTree.get n code) with
| Icond (cond, lr, ifso, ifnot) ->
+ Printf.printf "Analyzing %d.." (P.to_int n);
let preferred = ref false
in (try
+ Printf.printf " call..";
do_call_heuristic code ifso ifnot is_loop_header preferred;
+ Printf.printf " opcode..";
do_opcode_heuristic code cond ifso ifnot preferred;
+ Printf.printf " return..";
do_return_heuristic code ifso ifnot is_loop_header preferred;
+ Printf.printf " store..";
do_store_heuristic code ifso ifnot is_loop_header preferred;
+ Printf.printf " loop..";
do_loop_heuristic code ifso ifnot is_loop_header preferred;
Printf.printf "Random choice for %d\n" (P.to_int n);
preferred := Random.bool ()
- with HeuristicSucceeded | DuplicateOpcodeHeuristic.HeuristicSucceeded -> ()
+ with HeuristicSucceeded | DuplicateOpcodeHeuristic.HeuristicSucceeded
+ -> Printf.printf " %s\n" (match !preferred with true -> "BRANCH"
+ | false -> "FALLTHROUGH")
); directions := PTree.set n !preferred !directions
| _ -> ()
) bfs_order;