aboutsummaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2020-03-13 14:13:16 +0100
committerCyril SIX <cyril.six@kalray.eu>2020-03-13 14:13:16 +0100
commitdd345b4fd33a9e59507029f30da9a09d5e450db6 (patch)
tree3bcc8fb52a3cb500b9866b7f5db21a4dc615889d /backend
parent786ada1bd193e3995b948e2bd11d6285654a5c6a (diff)
downloadcompcert-kvx-dd345b4fd33a9e59507029f30da9a09d5e450db6.tar.gz
compcert-kvx-dd345b4fd33a9e59507029f30da9a09d5e450db6.zip
Added prediction info in the printers
Diffstat (limited to 'backend')
-rw-r--r--backend/PrintLTL.ml5
-rw-r--r--backend/PrintRTL.ml5
2 files changed, 6 insertions, 4 deletions
diff --git a/backend/PrintLTL.ml b/backend/PrintLTL.ml
index f173e374..d8f2ac12 100644
--- a/backend/PrintLTL.ml
+++ b/backend/PrintLTL.ml
@@ -83,10 +83,11 @@ let print_instruction pp succ = function
(print_builtin_args loc) args
| Lbranch s ->
print_succ pp s succ
- | Lcond(cond, args, s1, s2, _) ->
- fprintf pp "if (%a) goto %d else goto %d"
+ | Lcond(cond, args, s1, s2, info) ->
+ fprintf pp "if (%a) goto %d else goto %d (prediction: %s)"
(print_condition mreg) (cond, args)
(P.to_int s1) (P.to_int s2)
+ (match info with None -> "none" | Some true -> "branch" | Some false -> "fallthrough")
| Ljumptable(arg, tbl) ->
let tbl = Array.of_list tbl in
fprintf pp "jumptable (%a)" mreg arg;
diff --git a/backend/PrintRTL.ml b/backend/PrintRTL.ml
index 5eab9901..b2ef05ca 100644
--- a/backend/PrintRTL.ml
+++ b/backend/PrintRTL.ml
@@ -75,10 +75,11 @@ let print_instruction pp (pc, i) =
(name_of_external ef)
(print_builtin_args reg) args;
print_succ pp s (pc - 1)
- | Icond(cond, args, s1, s2, _) ->
- fprintf pp "if (%a) goto %d else goto %d\n"
+ | Icond(cond, args, s1, s2, info) ->
+ fprintf pp "if (%a) goto %d else goto %d (prediction: %s)\n"
(PrintOp.print_condition reg) (cond, args)
(P.to_int s1) (P.to_int s2)
+ (match info with None -> "none" | Some true -> "branch" | Some false -> "fallthrough")
| Ijumptable(arg, tbl) ->
let tbl = Array.of_list tbl in
fprintf pp "jumptable (%a)\n" reg arg;