Skip to content

Commit

Permalink
Merge branch 'main' into add_max_min_type_analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoyard authored Jan 26, 2024
2 parents 1bb9b90 + af10cc9 commit c03d132
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions enzyme/Enzyme/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ llvm::cl::opt<bool>
EnzymeStrongZero("enzyme-strong-zero", cl::init(false), cl::Hidden,
cl::desc("Use additional checks to ensure correct "
"behavior when handling functions with inf"));
llvm::cl::opt<bool> EnzymeMemmoveWarning(
"enzyme-memmove-warning", cl::init(true), cl::Hidden,
cl::desc("Warn if using memmove implementation as a fallback for memmove"));
}

void ZeroMemory(llvm::IRBuilder<> &Builder, llvm::Type *T, llvm::Value *obj,
Expand Down Expand Up @@ -1240,8 +1243,10 @@ Function *
getOrInsertDifferentialFloatMemmove(Module &M, Type *T, unsigned dstalign,
unsigned srcalign, unsigned dstaddr,
unsigned srcaddr, unsigned bitwidth) {
llvm::errs() << "warning: didn't implement memmove, using memcpy as fallback "
"which can result in errors\n";
if (EnzymeMemmoveWarning)
llvm::errs()
<< "warning: didn't implement memmove, using memcpy as fallback "
"which can result in errors\n";
return getOrInsertDifferentialFloatMemcpy(M, T, dstalign, srcalign, dstaddr,
srcaddr, bitwidth);
}
Expand Down

0 comments on commit c03d132

Please sign in to comment.