Commit 8b649e68 authored by Cyril SIX's avatar Cyril SIX
Browse files

Do not rotate if the CB was already at the end.

parent 9faa0b9e
......@@ -1044,9 +1044,13 @@ let extract_upto_icond f code head =
let rotate_inner_loop f code revmap iloop =
let header = extract_upto_icond f code iloop.head in
let limit = !Clflags.option_flooprotate in
if count_ignore_nops code header > limit then begin
let nb_duplicated = count_ignore_nops code header in
if nb_duplicated > limit then begin
debug "Loop Rotate: too many nodes to duplicate (%d > %d)" (List.length header) limit;
(code, revmap)
end else if nb_duplicated == count_ignore_nops code iloop.body then begin
debug "The conditional branch is already at the end! No need to rotate.";
(code, revmap)
end else
let (code2, revmap2, dupheader, fwmap) = clone code revmap header in
let code' = ref code2 in
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment