diff --git a/src/ast2ram/utility/SipsMetric.cpp b/src/ast2ram/utility/SipsMetric.cpp index fb94638d0db..3cf82a8df25 100644 --- a/src/ast2ram/utility/SipsMetric.cpp +++ b/src/ast2ram/utility/SipsMetric.cpp @@ -310,8 +310,15 @@ std::vector SelingerProfileSipsMetric::getReordering( /** Create a SIPS metric based on a given heuristic. */ std::unique_ptr SipsMetric::create(const std::string& heuristic, const TranslationUnit& tu) { if (tu.global().config().has("auto-schedule")) { - return mk(tu); - } else if (heuristic == "strict") + if (tu.getAnalysis().hasAutoSchedulerStats()) { + return mk(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(tu); else if (heuristic == "all-bound") return mk(tu);