Skip to content

Commit

Permalink
Remove unused loopUnrollingCallVisitor
Browse files Browse the repository at this point in the history
  • Loading branch information
karoliineh committed Sep 28, 2024
1 parent 446da4f commit e8f51dc
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions src/util/loopUnrolling.ml
Original file line number Diff line number Diff line change
Expand Up @@ -305,48 +305,9 @@ class arrayVisitor = object
end
let annotateArrays loopBody = ignore @@ visitCilBlock (new arrayVisitor) loopBody

(*unroll loops that handle locks, threads and mallocs, asserts and reach_error*)
class loopUnrollingCallVisitor = object
inherit nopCilVisitor

method! vinst = function
| Call (_,Lval ((Var info), NoOffset),args,_,_) when LibraryFunctions.is_special info -> (
Goblint_backtrace.wrap_val ~mark:(Cilfacade.FunVarinfo info) @@ fun () ->
let desc = LibraryFunctions.find info in
match desc.special args with
| Malloc _
| Calloc _
| Realloc _
| Alloca _
| Lock _
| Unlock _
| ThreadCreate _
| Assert _
| Bounded _
| ThreadJoin _ ->
raise Found;
| _ ->
if List.mem "specification" @@ get_string_list "ana.autotune.activated" && get_string "ana.specification" <> "" then (
if Svcomp.is_error_function' info (SvcompSpec.of_option ()) then
raise Found
);
DoChildren
)
| _ -> DoChildren

end

let loop_unrolling_factor loopStatement func totalLoops =
let configFactor = get_int "exp.unrolling-factor" in
if AutoTune0.isActivated "loopUnrollHeuristic" then
let unrollFunctionCalled = try
let thisVisitor = new loopUnrollingCallVisitor in
ignore (visitCilStmt thisVisitor loopStatement);
false;
with
Found -> true
in
(*unroll up to near an instruction count, higher if the loop uses malloc/lock/threads *)
let loopStats = AutoTune0.collectFactors visitCilStmt loopStatement in
if loopStats.instructions > 0 then
match fixedLoopSize loopStatement func with
Expand Down

0 comments on commit e8f51dc

Please sign in to comment.