@@ -87,6 +87,9 @@ llvm::cl::opt<bool>
8787 EnzymeStrongZero (" enzyme-strong-zero" , cl::init(false ), cl::Hidden,
8888 cl::desc(" Use additional checks to ensure correct "
8989 " behavior when handling functions with inf" ));
90+ llvm::cl::opt<bool > EnzymeMemmoveWarning (
91+ " enzyme-memmove-warning" , cl::init(true ), cl::Hidden,
92+ cl::desc(" Warn if using memmove implementation as a fallback for memmove" ));
9093}
9194
9295void ZeroMemory (llvm::IRBuilder<> &Builder, llvm::Type *T, llvm::Value *obj,
@@ -1240,8 +1243,10 @@ Function *
12401243getOrInsertDifferentialFloatMemmove (Module &M, Type *T, unsigned dstalign,
12411244 unsigned srcalign, unsigned dstaddr,
12421245 unsigned srcaddr, unsigned bitwidth) {
1243- llvm::errs () << " warning: didn't implement memmove, using memcpy as fallback "
1244- " which can result in errors\n " ;
1246+ if (EnzymeMemmoveWarning)
1247+ llvm::errs ()
1248+ << " warning: didn't implement memmove, using memcpy as fallback "
1249+ " which can result in errors\n " ;
12451250 return getOrInsertDifferentialFloatMemcpy (M, T, dstalign, srcalign, dstaddr,
12461251 srcaddr, bitwidth);
12471252}
0 commit comments