Skip to content

Commit

Permalink
Allow disabling memmove warning
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Jan 26, 2024
1 parent 0c98e26 commit 5808a7b
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> EnzymeStrongZero(
"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 5808a7b

Please sign in to comment.