aboutsummaryrefslogtreecommitdiffstats
path: root/backend/Duplicateaux.ml
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2020-10-16 12:31:42 +0200
committerCyril SIX <cyril.six@kalray.eu>2020-10-16 14:39:44 +0200
commitea96ae80041cc376f0ec3dce127b414a0a1514a0 (patch)
treee29a05279562cd9294acbd145af367e12a1b29e8 /backend/Duplicateaux.ml
parentb6dcf1d6881470eaf6b1163ceac8aa94e221b084 (diff)
downloadcompcert-kvx-ea96ae80041cc376f0ec3dce127b414a0a1514a0.tar.gz
compcert-kvx-ea96ae80041cc376f0ec3dce127b414a0a1514a0.zip
Comment update
Diffstat (limited to 'backend/Duplicateaux.ml')
-rw-r--r--backend/Duplicateaux.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/backend/Duplicateaux.ml b/backend/Duplicateaux.ml
index 08d0e1f2..ec7a4d02 100644
--- a/backend/Duplicateaux.ml
+++ b/backend/Duplicateaux.ml
@@ -29,6 +29,7 @@ let get_loop_headers = LICMaux.get_loop_headers
let get_some = LICMaux.get_some
let rtl_successors = LICMaux.rtl_successors
+(* Get list of nodes following a BFS of the code *)
let bfs code entrypoint = begin
debug "bfs\n";
let visited = ref (PTree.map (fun n i -> false) code)
@@ -57,6 +58,7 @@ let optbool o = match o with Some _ -> true | None -> false
let ptree_get_some n ptree = get_some @@ PTree.get n ptree
+(* Returns a PTree: node -> list of the predecessors of that node *)
let get_predecessors_rtl code = begin
debug "get_predecessors_rtl\n";
let preds = ref (PTree.map (fun n i -> []) code) in
@@ -125,6 +127,10 @@ let rec look_ahead code node is_loop_header predicate =
)
| _ -> false
+(**
+ * Heuristics mostly based on the paper Branch Prediction for Free
+ *)
+
let do_call_heuristic code cond ifso ifnot is_loop_header =
begin
debug "\tCall heuristic..\n";
@@ -253,7 +259,7 @@ let get_loop_info is_loop_header bfs_order code =
!loop_info
end
-(* Remark - compared to the original paper, we don't use the store heuristic *)
+(* Remark - compared to the original Branch Prediction for Free paper, we don't use the store heuristic *)
let get_directions code entrypoint = begin
debug "get_directions\n";
let bfs_order = bfs code entrypoint in