aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2020-03-17 15:12:06 +0100
committerCyril SIX <cyril.six@kalray.eu>2020-03-17 15:12:06 +0100
commitfb43d1078c0b0824132b30d7dd9bfe6b0ac47122 (patch)
treeb51287fed668d9fd06ab98f19dfe454d4c6a27b4
parentaa2e3d776cb82ce01c4afdbacc52951e60ff2104 (diff)
downloadcompcert-kvx-fb43d1078c0b0824132b30d7dd9bfe6b0ac47122.tar.gz
compcert-kvx-fb43d1078c0b0824132b30d7dd9bfe6b0ac47122.zip
Desactivating branch predictions by default
-rw-r--r--backend/Duplicateaux.ml18
-rw-r--r--driver/Clflags.ml2
-rw-r--r--driver/Driver.ml6
3 files changed, 17 insertions, 9 deletions
diff --git a/backend/Duplicateaux.ml b/backend/Duplicateaux.ml
index 209527b9..a84f9754 100644
--- a/backend/Duplicateaux.ml
+++ b/backend/Duplicateaux.ml
@@ -502,11 +502,15 @@ let rec invert_iconds code = function
let duplicate_aux f =
let entrypoint = f.fn_entrypoint in
let code = f.fn_code in
- let traces = select_traces (to_ttl_code code entrypoint) entrypoint in
- let icond_code = invert_iconds code traces in
- let preds = get_predecessors_rtl icond_code in
- if !Clflags.option_fduplicate >= 1 then
- let (new_code, pTreeId) = ((* print_traces traces; *) superblockify_traces icond_code preds traces) in
- ((new_code, f.fn_entrypoint), pTreeId)
+ if !Clflags.option_fduplicate < 0 then
+ ((code, entrypoint), make_identity_ptree code)
else
- ((icond_code, entrypoint), make_identity_ptree code)
+ let traces = select_traces (to_ttl_code code entrypoint) entrypoint in
+ let icond_code = invert_iconds code traces in
+ let preds = get_predecessors_rtl icond_code in
+ if !Clflags.option_fduplicate >= 1 then
+ let (new_code, pTreeId) = ((* print_traces traces; *) superblockify_traces icond_code preds traces) in
+ ((new_code, f.fn_entrypoint), pTreeId)
+ else
+ ((icond_code, entrypoint), make_identity_ptree code)
+
diff --git a/driver/Clflags.ml b/driver/Clflags.ml
index 8054eb5b..6986fb96 100644
--- a/driver/Clflags.ml
+++ b/driver/Clflags.ml
@@ -28,7 +28,7 @@ let option_fconstprop = ref true
let option_fcse = ref true
let option_fcse2 = ref true
let option_fredundancy = ref true
-let option_fduplicate = ref 0
+let option_fduplicate = ref (-1)
let option_finvertcond = ref true
let option_ftracelinearize = ref false
let option_fpostpass = ref true
diff --git a/driver/Driver.ml b/driver/Driver.ml
index 01451e07..388482a0 100644
--- a/driver/Driver.ml
+++ b/driver/Driver.ml
@@ -201,7 +201,11 @@ Processing options:
-fpostpass Perform postpass scheduling (only for K1 architecture) [on]
-fpostpass= <optim> Perform postpass scheduling with the specified optimization [list]
(<optim>=list: list scheduling, <optim>=ilp: ILP, <optim>=greedy: just packing bundles)
- -fduplicate Perform tail duplication to form superblocks on predicted traces
+ -fduplicate <nb_nodes> Perform tail duplication to form superblocks on predicted traces
+ nb_nodes control the heuristic deciding to duplicate or not
+ A value of -1 desactivates the entire pass (including branch prediction)
+ A value of 0 desactivates the duplication (but activates the branch prediction)
+ FIXME : this is desactivated by default for now
-finvertcond Invert conditions based on predicted paths (to prefer fallthrough).
Requires -fduplicate to be also activated [on]
-ftracelinearize Linearizes based on the traces identified by duplicate phase