diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2020-03-10 15:24:13 +0100 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2020-03-10 15:24:13 +0100 |
commit | 9a86085b2226905e8cf14b600f2069202c5d12bd (patch) | |
tree | d2fe920eb793e36185b7f1ed76b1267dda3afe79 /backend/Linearizeaux.ml | |
parent | 273c48f412d018e5d5649db266b282fc272a0af8 (diff) | |
download | compcert-kvx-9a86085b2226905e8cf14b600f2069202c5d12bd.tar.gz compcert-kvx-9a86085b2226905e8cf14b600f2069202c5d12bd.zip |
Some dependencies were not taken into account in tracelinearize
Diffstat (limited to 'backend/Linearizeaux.ml')
-rw-r--r-- | backend/Linearizeaux.ml | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/backend/Linearizeaux.ml b/backend/Linearizeaux.ml index bd8f747e..3602cb91 100644 --- a/backend/Linearizeaux.ml +++ b/backend/Linearizeaux.ml @@ -349,6 +349,14 @@ let construct_depmap code entry fs = ) fs; !index end + in let check_and_update_depmap from target = + if not (ppmap_is_true (from, target) is_loop_edge) then + let in_index_fs = find_index_of_node from in + let out_index_fs = find_index_of_node target in + if out_index_fs != in_index_fs then + depmap.(out_index_fs) <- ISet.add in_index_fs depmap.(out_index_fs) + else () + else () in let rec dfs_visit code = function | [] -> () | node :: ln -> @@ -360,25 +368,14 @@ let construct_depmap code entry fs = let next_visits = match (last_element bb) with | Ltailcall _ | Lreturn -> [] - | Lbranch n -> [n] + | Lbranch n -> (check_and_update_depmap node n; [n]) | Lcond (_, _, ifso, ifnot) -> begin - (if not (ppmap_is_true (node, ifso) is_loop_edge) then - let in_index_fs = find_index_of_node node in - let out_index_fs = find_index_of_node ifso in - depmap.(out_index_fs) <- ISet.add in_index_fs depmap.(out_index_fs) - else - ()); + check_and_update_depmap node ifso; + check_and_update_depmap node ifnot; [ifso; ifnot] end | Ljumptable(_, ln) -> begin - let in_index_fs = find_index_of_node node in - List.iter (fun n -> - if not (ppmap_is_true (node, n) is_loop_edge) then - let out_index_fs = find_index_of_node n in - depmap.(out_index_fs) <- ISet.add in_index_fs depmap.(out_index_fs) - else - () - ) ln; + List.iter (fun n -> check_and_update_depmap node n) ln; ln end (* end of bblocks should not be another value than one of the above *) |