Skip to content

Commit

Permalink
Remove totalLoops < 10 heuristic and just unroll fixed loops when <= 100
Browse files Browse the repository at this point in the history
  • Loading branch information
karoliineh committed Jun 20, 2024
1 parent a2f43a2 commit 9cf2531
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/loopUnrolling.ml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ let loop_unrolling_factor loopStatement func totalLoops =
(* Unroll at least 10 times if there are only few (17?) loops *)
let unroll_min = if totalLoops < 17 && AutoTune0.isActivated "forceLoopUnrollForFewLoops" then 10 else 0 in
match fixedLoop with
| Some i -> if i * loopStats.instructions < 100 || totalLoops < 10 then (Logs.debug "fixed loop size"; i) else max unroll_min (100 / loopStats.instructions)
| Some i when i <= 100 -> Logs.debug "fixed loop size"; i
| _ -> max unroll_min (targetInstructions / loopStats.instructions)
else
(* Don't unroll empty (= while(1){}) loops*)
Expand Down

0 comments on commit 9cf2531

Please sign in to comment.