Skip to content

Commit

Permalink
add flag to loose coverage check
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrantq committed Feb 7, 2025
1 parent 7d97fe7 commit 2eee5d4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion enzyme/Enzyme/Herbie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ static cl::opt<bool> FPOptEnableSolver(
static cl::opt<std::string> FPOptSolverType("fpopt-solver-type", cl::init("dp"),
cl::Hidden,
cl::desc("Which solver to use"));
static cl::opt<bool> FPOptLooseCoverage(
"fpopt-loose-coverage", cl::init(false), cl::Hidden,
cl::desc("Allow unexecuted FP instructions in subgraph indentification"));
static cl::opt<bool> FPOptShowTable(
"fpopt-show-table", cl::init(false), cl::Hidden,
cl::desc(
Expand Down Expand Up @@ -4822,7 +4825,15 @@ bool fpOptimize(Function &F, const TargetTransformInfo &TTI) {

bool res = extractValueFromLog(FPOptLogPath, functionName,
blockIdx, instIdx, valueInfo);
assert(res && "FP instruction not found in log!");
if (!res) {
if (FPOptLooseCoverage)
continue;
llvm::errs() << "FP Instruction " << *I2
<< " has no execution logged!\n";
llvm_unreachable(
"Unexecuted instruction found; set -fpopt-loose-coverage "
"to suppress this error\n");
}
auto node = valueToNodeMap[operand];
node->updateBounds(valueInfo.lower[i], valueInfo.upper[i]);

Expand Down

0 comments on commit 2eee5d4

Please sign in to comment.