Skip to content

Commit

Permalink
Do not use SelingerProfileSipsMetric if no profile available.
Browse files Browse the repository at this point in the history
There is a bug #2426, which causes an assertion in the
SelingerProfileSipsMetric::getReordering.

Rther than fixing the problem I decided to work-around it for
the time being, until we have a proper fix.

We can work around this problem in one of two ways:
1. don't assert and just don't reorder atoms (this should be fine)
2. don't create the metric in the first place, if there is no profile

I decided to use #2 as that seems to be the safer option.

I added code for a warning, but disabled it because it is incompatible
with the ctest suite.
  • Loading branch information
strRM committed Nov 13, 2024
1 parent 3ae2a70 commit 5187f90
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/ast2ram/utility/SipsMetric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,15 @@ std::vector<std::size_t> SelingerProfileSipsMetric::getReordering(
/** Create a SIPS metric based on a given heuristic. */
std::unique_ptr<SipsMetric> SipsMetric::create(const std::string& heuristic, const TranslationUnit& tu) {
if (tu.global().config().has("auto-schedule")) {
return mk<SelingerProfileSipsMetric>(tu);
} else if (heuristic == "strict")
if (tu.getAnalysis<ast::analysis::ProfileUseAnalysis>().hasAutoSchedulerStats()) {
return mk<SelingerProfileSipsMetric>(tu);
} else {
std::cerr << "WARNING: `--auto-schedule` cannot be used due to missing scheduler stats; falling back "
"to heuristic '"
<< heuristic << "'" << ::std::endl;
}
}
if (heuristic == "strict")
return mk<StrictSips>(tu);
else if (heuristic == "all-bound")
return mk<AllBoundSips>(tu);
Expand Down

0 comments on commit 5187f90

Please sign in to comment.