Skip to content

Commit

Permalink
enzyme_active
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrantq committed Nov 12, 2024
1 parent 7145c49 commit e39bee8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions enzyme/Enzyme/FunctionUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,8 @@ Function *PreProcessCache::preprocessForClone(Function *F,
continue;
}
auto *after = cast<Instruction>(pair.second);
after->setMetadata("enzyme_active",
MDNode::get(after->getContext(), None));
after->setMetadata(
"enzyme_preprocess_origin",
MDTuple::get(after->getContext(),
Expand Down
5 changes: 5 additions & 0 deletions enzyme/Enzyme/Herbie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2210,6 +2210,9 @@ InstructionCost getInstructionCompCost(const Instruction *I,
llvm_unreachable(msg.c_str());
}

llvm::errs()
<< "IMPORTANT: Custom cost model not provided, using default cost!\n";

unsigned Opcode = I->getOpcode();
switch (Opcode) {
case Instruction::FNeg: {
Expand Down Expand Up @@ -4453,6 +4456,8 @@ bool fpOptimize(Function &F, const TargetTransformInfo &TTI) {

// TODO: For now just skip if grad is 0
if (!FPOptLogPath.empty() && grad == 0.) {
llvm::errs() << "Skipping algebraic rewriting for " << *output
<< " since gradient is 0\n";
continue;
}

Expand Down

0 comments on commit e39bee8

Please sign in to comment.