diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-10-02 21:16:07 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-10-02 21:16:07 +0200 |
commit | b5101e0d9c21810bd40253e3676838f87558e879 (patch) | |
tree | 57f307cf4c5fc4020f4e8724be49877fe1ff0f2b /backend | |
parent | 99d46d24e0282c3e4c5fe8765f4e755a1b3b0253 (diff) | |
parent | 043a6caa766bf1f3508b389cd3c7ae69d596eded (diff) | |
download | compcert-kvx-b5101e0d9c21810bd40253e3676838f87558e879.tar.gz compcert-kvx-b5101e0d9c21810bd40253e3676838f87558e879.zip |
Merge remote-tracking branch 'origin/kvx-work' into kvx-test-prepass
Diffstat (limited to 'backend')
-rw-r--r-- | backend/Duplicateaux.ml | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/backend/Duplicateaux.ml b/backend/Duplicateaux.ml index 00819834..1297ec90 100644 --- a/backend/Duplicateaux.ml +++ b/backend/Duplicateaux.ml @@ -314,7 +314,9 @@ let get_directions code entrypoint = begin (* debug "\n"; *) List.iter (fun n -> match (get_some @@ PTree.get n code) with - | Icond (cond, lr, ifso, ifnot, _) -> + | Icond (cond, lr, ifso, ifnot, pred) -> + (match pred with Some _ -> debug "RTL node %d already has prediction information\n" (P.to_int n) + | None -> (* debug "Analyzing %d.." (P.to_int n); *) let heuristics = [ do_opcode_heuristic; do_return_heuristic; do_loop2_heuristic loop_info n; do_loop_heuristic; do_call_heuristic; @@ -333,6 +335,7 @@ let get_directions code entrypoint = begin | None -> debug "\tUNSURE\n"); debug "---------------------------------------\n" end + ) | _ -> () ) bfs_order; !directions @@ -340,7 +343,11 @@ let get_directions code entrypoint = begin end let update_direction direction = function -| Icond (cond, lr, n, n', _) -> Icond (cond, lr, n, n', direction) +| Icond (cond, lr, n, n', pred) -> + (* only update if there is no prior existing branch prediction *) + (match pred with + | None -> Icond (cond, lr, n, n', direction) + | Some _ -> Icond (cond, lr, n, n', pred) ) | i -> i let rec update_direction_rec directions = function |