Skip to content

Commit

Permalink
add autotuner for math functions (activates tmpSpecial and float domain)
Browse files Browse the repository at this point in the history
  • Loading branch information
stilscher committed Nov 20, 2023
1 parent c9be89e commit 75b3b83
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/autoTune.ml
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,17 @@ let wideningOption factors file =
print_endline "Enabled widening thresholds";
}

let activateTmpSpecialAnalysis () =
let isMathFun = function
| LibraryDesc.Math _ -> true
| _ -> false
in
let hasMathFunctions = hasFunction isMathFun in
if hasMathFunctions then (
print_endline @@ "math function -> enabling tmpSpecial analysis and floating-point domain";
enableAnalyses ["tmpSpecial"];
set_bool "ana.float.interval" true;
)

let estimateComplexity factors file =
let pathsEstimate = factors.loops + factors.controlFlowStatements / 90 in
Expand Down Expand Up @@ -518,6 +529,9 @@ let chooseConfig file =
if isActivated "arrayDomain" then
selectArrayDomains file;

if isActivated "tmpSpecialAnalysis" then
activateTmpSpecialAnalysis ();

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
Expand Down
2 changes: 1 addition & 1 deletion src/common/util/options.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@
"type": "array",
"items": { "type": "string" },
"default": [
"congruence", "singleThreaded", "specification", "mallocWrappers", "noRecursiveIntervals", "enums", "loopUnrollHeuristic", "arrayDomain", "octagon", "wideningThresholds", "memsafetySpecification"
"congruence", "singleThreaded", "specification", "mallocWrappers", "noRecursiveIntervals", "enums", "loopUnrollHeuristic", "arrayDomain", "octagon", "wideningThresholds", "memsafetySpecification", "tmpSpecialAnalysis"
]
}
},
Expand Down

0 comments on commit 75b3b83

Please sign in to comment.