From f6a987b784800c04add49b0b50d8d383f8ed4c0b Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Fri, 25 Sep 2009 20:54:50 +0000 Subject: Handle sqrt in CannotBeNegativeZero. absf and absl appear to be misspellings, removed in favor of fabs*. llvm-svn: 82796 --- llvm/lib/Analysis/ValueTracking.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Analysis/ValueTracking.cpp') diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 9494a2f4c53..baa347a6638 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -840,9 +840,13 @@ bool llvm::CannotBeNegativeZero(const Value *V, unsigned Depth) { if (F->isDeclaration()) { // abs(x) != -0.0 if (F->getName() == "abs") return true; - // abs[lf](x) != -0.0 - if (F->getName() == "absf") return true; - if (F->getName() == "absl") return true; + // fabs[lf](x) != -0.0 + if (F->getName() == "fabs") return true; + if (F->getName() == "fabsf") return true; + if (F->getName() == "fabsl") return true; + if (F->getName() == "sqrt" || F->getName() == "sqrtf" || + F->getName() == "sqrtl") + return CannotBeNegativeZero(CI->getOperand(1), Depth+1); } } -- cgit v1.2.3