Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autotune: Conditionally activate congruence integer domain #911

Merged
merged 4 commits into from
Nov 22, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/autoTune.ml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,21 @@ class octagonFunctionVisitor(list, amount) = object

end

let congruenceOption factors file =
let locals, globals = factors.integralVars in
let cost = (locals + globals) * (factors.instructions / 12) + 5 * factors.functionCalls in
let value = 5 * locals + globals in
let activate () =
print_endline @@ "Congruence: " ^ string_of_int cost;
set_bool "ana.int.congruence" true;
print_endline "Enabled congruence domain.";
in
{
value;
cost;
activate;
michael-schwarz marked this conversation as resolved.
Show resolved Hide resolved
}

let apronOctagonOption factors file =
let locals =
if List.mem "specification" (get_string_list "ana.autotune.activated" ) && get_string "ana.specification" <> "" then
Expand Down Expand Up @@ -429,6 +444,7 @@ let chooseConfig file =
print_endline @@ "File: " ^ string_of_int fileCompplexity;

let options = [] in
let options = if isActivated "congruence" then (congruenceOption factors file)::options else options in
let options = if isActivated "octagon" then (apronOctagonOption factors file)::options else options in
let options = if isActivated "wideningThresholds" then (wideningOption factors file)::options else options in

Expand Down