diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2021-04-02 11:41:41 +0200 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2021-04-02 11:41:41 +0200 |
commit | 6ee3ecb0edc17d61a515054952827c495cc03979 (patch) | |
tree | 1ad7a9ba58b2f27259ea822c7e7f0a45b7fbb0ec /common | |
parent | fe7a71c232068bc57e7e14935ff443a4a6315dac (diff) | |
download | compcert-kvx-6ee3ecb0edc17d61a515054952827c495cc03979.tar.gz compcert-kvx-6ee3ecb0edc17d61a515054952827c495cc03979.zip |
Simple backedge detection (modified code from get_loop_headers)
Diffstat (limited to 'common')
-rw-r--r-- | common/DebugPrint.ml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/common/DebugPrint.ml b/common/DebugPrint.ml index 64efe727..931dfdf4 100644 --- a/common/DebugPrint.ml +++ b/common/DebugPrint.ml @@ -20,6 +20,20 @@ let print_ptree_bool oc pt = end else () +let print_ptree_opint oc pt = + if !debug_flag then + let elements = PTree.elements pt in + begin + Printf.fprintf oc "["; + List.iter (fun (n, op) -> + match op with + | None -> () + | Some p -> Printf.fprintf oc "%d -> %d, " (P.to_int n) (P.to_int p) + ) elements; + Printf.fprintf oc "]\n" + end + else () + let print_intlist oc l = let rec f oc = function | [] -> () |