diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2020-03-10 15:23:41 +0100 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2020-03-10 15:23:41 +0100 |
commit | 273c48f412d018e5d5649db266b282fc272a0af8 (patch) | |
tree | 155fd6401fe5baf217664d73478ee38b0f3f1f7e /backend/Linearizeaux.ml | |
parent | 22bfb4389571e9b2779b6e5b9f48b8a0e5c35867 (diff) | |
download | compcert-kvx-273c48f412d018e5d5649db266b282fc272a0af8.tar.gz compcert-kvx-273c48f412d018e5d5649db266b282fc272a0af8.zip |
Linearize: More helpful message when tracelinearize fails
Diffstat (limited to 'backend/Linearizeaux.ml')
-rw-r--r-- | backend/Linearizeaux.ml | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/backend/Linearizeaux.ml b/backend/Linearizeaux.ml index 23d06075..bd8f747e 100644 --- a/backend/Linearizeaux.ml +++ b/backend/Linearizeaux.ml @@ -415,16 +415,24 @@ let order_sequences code entry fs = ) depmap end in let select_next () = - let selected_id = ref (-1) in + let selected_id = ref None in begin Array.iteri (fun i deps -> begin (* Printf.printf "Deps: "; print_iset deps; Printf.printf "\n"; *) - if !selected_id == -1 && deps == ISet.empty && not fs_evaluated.(i) - then selected_id := i + match !selected_id with + | None -> if (deps == ISet.empty && not fs_evaluated.(i)) then selected_id := Some i + | Some id -> () end ) depmap; - !selected_id + match !selected_id with + | Some id -> id + | None -> begin + Printf.printf "original fs: "; print_ssequence fs; + Printf.printf "depmap: "; print_depmap depmap; + Printf.printf "current ordered fs: "; print_ssequence @@ List.rev (!ordered_fs); + failwith "Could not find a next schedulable trace. Are the dependencies alright?" + end end in begin (* Printf.printf "depmap: "; print_depmap depmap; *) |