<div dir="ltr">nvm, I posted wrong log. This is the right one.<div><br></div><div><div>define void @T() {</div><div>entry:</div><div>  %log1 = call double @log(double 0.000000e+00)</div><div>  %log2 = call double @log(double -1.000000e+00)</div><div>  %exp2 = call double @exp(double 1.000000e+03)</div><div>  %cos2 = call double @cos(double 0x7FF0000000000000)</div><div>  %fmod2 = call double @fmod(double 0x7FF0000000000000, double 1.000000e+00)</div><div>  ret void</div><div>}</div></div><div><br></div><div>I am investigating.</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 4, 2016 at 3:45 AM NAKAMURA Takumi <<a href="mailto:geek4civic@gmail.com">geek4civic@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">FYI, it emits %pow1.<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">  %cos2 = call double @cos(double 0x7FF0000000000000)</div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">  %pow1 = call double @pow(double 0x7FF0000000000000, double 1.000000e+00)</div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">  %pow2 = call double @pow(double 0.000000e+00, double -1.000000e+00)</div><div class="gmail_msg"><br class="gmail_msg"></div><br class="gmail_msg"></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Thu, Nov 3, 2016 at 2:29 PM Yaron Keren via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="rtl" class="gmail_msg"><div dir="ltr" class="gmail_msg">Hi Eli,</div><div dir="ltr" class="gmail_msg"><br class="gmail_msg"></div><div dir="ltr" class="gmail_msg">The test is failing here</div><div dir="ltr" class="gmail_msg"><br class="gmail_msg"></div><div dir="ltr" class="gmail_msg"><a href="http://bb.pgr.jp/builders/ninja-clang-x64-mingw64-RA/builds/13954/steps/test-llvm/logs/LLVM%20%3A%3A%20Transforms__DCE__calls-errno.ll" class="gmail_msg" target="_blank">http://bb.pgr.jp/builders/ninja-clang-x64-mingw64-RA/builds/13954/steps/test-llvm/logs/LLVM%20%3A%3A%20Transforms__DCE__calls-errno.ll</a><br class="gmail_msg"></div></div><div dir="rtl" class="gmail_msg"><div dir="ltr" class="gmail_msg"><br class="gmail_msg"></div><div dir="ltr" class="gmail_msg">Yaron</div><div dir="ltr" class="gmail_msg"><br class="gmail_msg"></div></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">2016-11-02 22:48 GMT+02:00 Eli Friedman via llvm-commits <span dir="ltr" class="gmail_msg"><<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a>></span>:</div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: efriedma<br class="gmail_msg">
Date: Wed Nov  2 15:48:11 2016<br class="gmail_msg">
New Revision: 285857<br class="gmail_msg">
<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=285857&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=285857&view=rev</a><br class="gmail_msg">
Log:<br class="gmail_msg">
DCE math library calls with a constant operand.<br class="gmail_msg">
<br class="gmail_msg">
On platforms which use -fmath-errno, math libcalls without any uses<br class="gmail_msg">
require some extra checks to figure out if they are actually dead.<br class="gmail_msg">
<br class="gmail_msg">
Fixes <a href="https://llvm.org/bugs/show_bug.cgi?id=30464" rel="noreferrer" class="gmail_msg" target="_blank">https://llvm.org/bugs/show_bug.cgi?id=30464</a> .<br class="gmail_msg">
<br class="gmail_msg">
Differential Revision: <a href="https://reviews.llvm.org/D25970" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D25970</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Added:<br class="gmail_msg">
    llvm/trunk/test/Transforms/DCE/calls-errno.ll<br class="gmail_msg">
Modified:<br class="gmail_msg">
    llvm/trunk/include/llvm/Analysis/ConstantFolding.h<br class="gmail_msg">
    llvm/trunk/lib/Analysis/ConstantFolding.cpp<br class="gmail_msg">
    llvm/trunk/lib/Transforms/Utils/Local.cpp<br class="gmail_msg">
<br class="gmail_msg">
Modified: llvm/trunk/include/llvm/Analysis/ConstantFolding.h<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ConstantFolding.h?rev=285857&r1=285856&r2=285857&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ConstantFolding.h?rev=285857&r1=285856&r2=285857&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/include/llvm/Analysis/ConstantFolding.h (original)<br class="gmail_msg">
+++ llvm/trunk/include/llvm/Analysis/ConstantFolding.h Wed Nov  2 15:48:11 2016<br class="gmail_msg">
@@ -23,6 +23,7 @@<br class="gmail_msg">
 namespace llvm {<br class="gmail_msg">
 class APInt;<br class="gmail_msg">
 template <typename T> class ArrayRef;<br class="gmail_msg">
+class CallSite;<br class="gmail_msg">
 class Constant;<br class="gmail_msg">
 class ConstantExpr;<br class="gmail_msg">
 class ConstantVector;<br class="gmail_msg">
@@ -125,6 +126,10 @@ bool canConstantFoldCallTo(const Functio<br class="gmail_msg">
 /// with the specified arguments, returning null if unsuccessful.<br class="gmail_msg">
 Constant *ConstantFoldCall(Function *F, ArrayRef<Constant *> Operands,<br class="gmail_msg">
                            const TargetLibraryInfo *TLI = nullptr);<br class="gmail_msg">
+<br class="gmail_msg">
+/// \brief Check whether the given call has no side-effects.<br class="gmail_msg">
+/// Specifically checks for math routimes which sometimes set errno.<br class="gmail_msg">
+bool isMathLibCallNoop(CallSite CS, const TargetLibraryInfo *TLI);<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
 #endif<br class="gmail_msg">
<br class="gmail_msg">
Modified: llvm/trunk/lib/Analysis/ConstantFolding.cpp<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ConstantFolding.cpp?rev=285857&r1=285856&r2=285857&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ConstantFolding.cpp?rev=285857&r1=285856&r2=285857&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/lib/Analysis/ConstantFolding.cpp (original)<br class="gmail_msg">
+++ llvm/trunk/lib/Analysis/ConstantFolding.cpp Wed Nov  2 15:48:11 2016<br class="gmail_msg">
@@ -1967,3 +1967,152 @@ llvm::ConstantFoldCall(Function *F, Arra<br class="gmail_msg">
<br class="gmail_msg">
   return ConstantFoldScalarCall(Name, F->getIntrinsicID(), Ty, Operands, TLI);<br class="gmail_msg">
 }<br class="gmail_msg">
+<br class="gmail_msg">
+bool llvm::isMathLibCallNoop(CallSite CS, const TargetLibraryInfo *TLI) {<br class="gmail_msg">
+  // FIXME: Refactor this code; this duplicates logic in LibCallsShrinkWrap<br class="gmail_msg">
+  // (and to some extent ConstantFoldScalarCall).<br class="gmail_msg">
+  Function *F = CS.getCalledFunction();<br class="gmail_msg">
+  if (!F)<br class="gmail_msg">
+    return false;<br class="gmail_msg">
+<br class="gmail_msg">
+  LibFunc::Func Func;<br class="gmail_msg">
+  if (!TLI || !TLI->getLibFunc(*F, Func))<br class="gmail_msg">
+    return false;<br class="gmail_msg">
+<br class="gmail_msg">
+  if (CS.getNumArgOperands() == 1) {<br class="gmail_msg">
+    if (ConstantFP *OpC = dyn_cast<ConstantFP>(CS.getArgOperand(0))) {<br class="gmail_msg">
+      const APFloat &Op = OpC->getValueAPF();<br class="gmail_msg">
+      switch (Func) {<br class="gmail_msg">
+      case LibFunc::logl:<br class="gmail_msg">
+      case LibFunc::log:<br class="gmail_msg">
+      case LibFunc::logf:<br class="gmail_msg">
+      case LibFunc::log2l:<br class="gmail_msg">
+      case LibFunc::log2:<br class="gmail_msg">
+      case LibFunc::log2f:<br class="gmail_msg">
+      case LibFunc::log10l:<br class="gmail_msg">
+      case LibFunc::log10:<br class="gmail_msg">
+      case LibFunc::log10f:<br class="gmail_msg">
+        return Op.isNaN() || (!Op.isZero() && !Op.isNegative());<br class="gmail_msg">
+<br class="gmail_msg">
+      case LibFunc::expl:<br class="gmail_msg">
+      case LibFunc::exp:<br class="gmail_msg">
+      case LibFunc::expf:<br class="gmail_msg">
+        // FIXME: These boundaries are slightly conservative.<br class="gmail_msg">
+        if (OpC->getType()->isDoubleTy())<br class="gmail_msg">
+          return Op.compare(APFloat(-745.0)) != APFloat::cmpLessThan &&<br class="gmail_msg">
+                 Op.compare(APFloat(709.0)) != APFloat::cmpGreaterThan;<br class="gmail_msg">
+        if (OpC->getType()->isFloatTy())<br class="gmail_msg">
+          return Op.compare(APFloat(-103.0f)) != APFloat::cmpLessThan &&<br class="gmail_msg">
+                 Op.compare(APFloat(88.0f)) != APFloat::cmpGreaterThan;<br class="gmail_msg">
+        break;<br class="gmail_msg">
+<br class="gmail_msg">
+      case LibFunc::exp2l:<br class="gmail_msg">
+      case LibFunc::exp2:<br class="gmail_msg">
+      case LibFunc::exp2f:<br class="gmail_msg">
+        // FIXME: These boundaries are slightly conservative.<br class="gmail_msg">
+        if (OpC->getType()->isDoubleTy())<br class="gmail_msg">
+          return Op.compare(APFloat(-1074.0)) != APFloat::cmpLessThan &&<br class="gmail_msg">
+                 Op.compare(APFloat(1023.0)) != APFloat::cmpGreaterThan;<br class="gmail_msg">
+        if (OpC->getType()->isFloatTy())<br class="gmail_msg">
+          return Op.compare(APFloat(-149.0f)) != APFloat::cmpLessThan &&<br class="gmail_msg">
+                 Op.compare(APFloat(127.0f)) != APFloat::cmpGreaterThan;<br class="gmail_msg">
+        break;<br class="gmail_msg">
+<br class="gmail_msg">
+      case LibFunc::sinl:<br class="gmail_msg">
+      case LibFunc::sin:<br class="gmail_msg">
+      case LibFunc::sinf:<br class="gmail_msg">
+      case LibFunc::cosl:<br class="gmail_msg">
+      case LibFunc::cos:<br class="gmail_msg">
+      case LibFunc::cosf:<br class="gmail_msg">
+        return !Op.isInfinity();<br class="gmail_msg">
+<br class="gmail_msg">
+      case LibFunc::tanl:<br class="gmail_msg">
+      case LibFunc::tan:<br class="gmail_msg">
+      case LibFunc::tanf: {<br class="gmail_msg">
+        // FIXME: Stop using the host math library.<br class="gmail_msg">
+        // FIXME: The computation isn't done in the right precision.<br class="gmail_msg">
+        Type *Ty = OpC->getType();<br class="gmail_msg">
+        if (Ty->isDoubleTy() || Ty->isFloatTy() || Ty->isHalfTy()) {<br class="gmail_msg">
+          double OpV = getValueAsDouble(OpC);<br class="gmail_msg">
+          return ConstantFoldFP(tan, OpV, Ty) != nullptr;<br class="gmail_msg">
+        }<br class="gmail_msg">
+        break;<br class="gmail_msg">
+      }<br class="gmail_msg">
+<br class="gmail_msg">
+      case LibFunc::asinl:<br class="gmail_msg">
+      case LibFunc::asin:<br class="gmail_msg">
+      case LibFunc::asinf:<br class="gmail_msg">
+      case LibFunc::acosl:<br class="gmail_msg">
+      case LibFunc::acos:<br class="gmail_msg">
+      case LibFunc::acosf:<br class="gmail_msg">
+        return Op.compare(APFloat(Op.getSemantics(), "-1")) !=<br class="gmail_msg">
+                   APFloat::cmpLessThan &&<br class="gmail_msg">
+               Op.compare(APFloat(Op.getSemantics(), "1")) !=<br class="gmail_msg">
+                   APFloat::cmpGreaterThan;<br class="gmail_msg">
+<br class="gmail_msg">
+      case LibFunc::sinh:<br class="gmail_msg">
+      case LibFunc::cosh:<br class="gmail_msg">
+      case LibFunc::sinhf:<br class="gmail_msg">
+      case LibFunc::coshf:<br class="gmail_msg">
+      case LibFunc::sinhl:<br class="gmail_msg">
+      case LibFunc::coshl:<br class="gmail_msg">
+        // FIXME: These boundaries are slightly conservative.<br class="gmail_msg">
+        if (OpC->getType()->isDoubleTy())<br class="gmail_msg">
+          return Op.compare(APFloat(-710.0)) != APFloat::cmpLessThan &&<br class="gmail_msg">
+                 Op.compare(APFloat(710.0)) != APFloat::cmpGreaterThan;<br class="gmail_msg">
+        if (OpC->getType()->isFloatTy())<br class="gmail_msg">
+          return Op.compare(APFloat(-89.0f)) != APFloat::cmpLessThan &&<br class="gmail_msg">
+                 Op.compare(APFloat(89.0f)) != APFloat::cmpGreaterThan;<br class="gmail_msg">
+        break;<br class="gmail_msg">
+<br class="gmail_msg">
+      case LibFunc::sqrtl:<br class="gmail_msg">
+      case LibFunc::sqrt:<br class="gmail_msg">
+      case LibFunc::sqrtf:<br class="gmail_msg">
+        return Op.isNaN() || Op.isZero() || !Op.isNegative();<br class="gmail_msg">
+<br class="gmail_msg">
+      // FIXME: Add more functions: sqrt_finite, atanh, expm1, log1p,<br class="gmail_msg">
+      // maybe others?<br class="gmail_msg">
+      default:<br class="gmail_msg">
+        break;<br class="gmail_msg">
+      }<br class="gmail_msg">
+    }<br class="gmail_msg">
+  }<br class="gmail_msg">
+<br class="gmail_msg">
+  if (CS.getNumArgOperands() == 2) {<br class="gmail_msg">
+    ConstantFP *Op0C = dyn_cast<ConstantFP>(CS.getArgOperand(0));<br class="gmail_msg">
+    ConstantFP *Op1C = dyn_cast<ConstantFP>(CS.getArgOperand(1));<br class="gmail_msg">
+    if (Op0C && Op1C) {<br class="gmail_msg">
+      const APFloat &Op0 = Op0C->getValueAPF();<br class="gmail_msg">
+      const APFloat &Op1 = Op1C->getValueAPF();<br class="gmail_msg">
+<br class="gmail_msg">
+      switch (Func) {<br class="gmail_msg">
+      case LibFunc::powl:<br class="gmail_msg">
+      case LibFunc::pow:<br class="gmail_msg">
+      case LibFunc::powf: {<br class="gmail_msg">
+        // FIXME: Stop using the host math library.<br class="gmail_msg">
+        // FIXME: The computation isn't done in the right precision.<br class="gmail_msg">
+        Type *Ty = Op0C->getType();<br class="gmail_msg">
+        if (Ty->isDoubleTy() || Ty->isFloatTy() || Ty->isHalfTy()) {<br class="gmail_msg">
+          if (Ty == Op1C->getType()) {<br class="gmail_msg">
+            double Op0V = getValueAsDouble(Op0C);<br class="gmail_msg">
+            double Op1V = getValueAsDouble(Op1C);<br class="gmail_msg">
+            return ConstantFoldBinaryFP(pow, Op0V, Op1V, Ty) != nullptr;<br class="gmail_msg">
+          }<br class="gmail_msg">
+        }<br class="gmail_msg">
+        break;<br class="gmail_msg">
+      }<br class="gmail_msg">
+<br class="gmail_msg">
+      case LibFunc::fmodl:<br class="gmail_msg">
+      case LibFunc::fmod:<br class="gmail_msg">
+      case LibFunc::fmodf:<br class="gmail_msg">
+        return Op0.isNaN() || Op1.isNaN() ||<br class="gmail_msg">
+               (!Op0.isInfinity() && !Op1.isZero());<br class="gmail_msg">
+<br class="gmail_msg">
+      default:<br class="gmail_msg">
+        break;<br class="gmail_msg">
+      }<br class="gmail_msg">
+    }<br class="gmail_msg">
+  }<br class="gmail_msg">
+<br class="gmail_msg">
+  return false;<br class="gmail_msg">
+}<br class="gmail_msg">
<br class="gmail_msg">
Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=285857&r1=285856&r2=285857&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=285857&r1=285856&r2=285857&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)<br class="gmail_msg">
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Wed Nov  2 15:48:11 2016<br class="gmail_msg">
@@ -340,6 +340,10 @@ bool llvm::isInstructionTriviallyDead(In<br class="gmail_msg">
     if (Constant *C = dyn_cast<Constant>(CI->getArgOperand(0)))<br class="gmail_msg">
       return C->isNullValue() || isa<UndefValue>(C);<br class="gmail_msg">
<br class="gmail_msg">
+  if (CallSite CS = CallSite(I))<br class="gmail_msg">
+    if (isMathLibCallNoop(CS, TLI))<br class="gmail_msg">
+      return true;<br class="gmail_msg">
+<br class="gmail_msg">
   return false;<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Added: llvm/trunk/test/Transforms/DCE/calls-errno.ll<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DCE/calls-errno.ll?rev=285857&view=auto" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DCE/calls-errno.ll?rev=285857&view=auto</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/test/Transforms/DCE/calls-errno.ll (added)<br class="gmail_msg">
+++ llvm/trunk/test/Transforms/DCE/calls-errno.ll Wed Nov  2 15:48:11 2016<br class="gmail_msg">
@@ -0,0 +1,91 @@<br class="gmail_msg">
+; RUN: opt < %s -dce -S | FileCheck %s<br class="gmail_msg">
+<br class="gmail_msg">
+declare double @acos(double) nounwind<br class="gmail_msg">
+declare double @asin(double) nounwind<br class="gmail_msg">
+declare double @atan(double) nounwind<br class="gmail_msg">
+declare double @atan2(double, double) nounwind<br class="gmail_msg">
+declare double @ceil(double) nounwind<br class="gmail_msg">
+declare double @cos(double) nounwind<br class="gmail_msg">
+declare double @cosh(double) nounwind<br class="gmail_msg">
+declare double @exp(double) nounwind<br class="gmail_msg">
+declare double @exp2(double) nounwind<br class="gmail_msg">
+declare double @fabs(double) nounwind<br class="gmail_msg">
+declare double @floor(double) nounwind<br class="gmail_msg">
+declare double @fmod(double, double) nounwind<br class="gmail_msg">
+declare double @log(double) nounwind<br class="gmail_msg">
+declare double @log10(double) nounwind<br class="gmail_msg">
+declare double @pow(double, double) nounwind<br class="gmail_msg">
+declare double @sin(double) nounwind<br class="gmail_msg">
+declare double @sinh(double) nounwind<br class="gmail_msg">
+declare double @sqrt(double) nounwind<br class="gmail_msg">
+declare double @tan(double) nounwind<br class="gmail_msg">
+declare double @tanh(double) nounwind<br class="gmail_msg">
+<br class="gmail_msg">
+declare float @acosf(float) nounwind<br class="gmail_msg">
+declare float @asinf(float) nounwind<br class="gmail_msg">
+declare float @atanf(float) nounwind<br class="gmail_msg">
+declare float @atan2f(float, float) nounwind<br class="gmail_msg">
+declare float @ceilf(float) nounwind<br class="gmail_msg">
+declare float @cosf(float) nounwind<br class="gmail_msg">
+declare float @coshf(float) nounwind<br class="gmail_msg">
+declare float @expf(float) nounwind<br class="gmail_msg">
+declare float @exp2f(float) nounwind<br class="gmail_msg">
+declare float @fabsf(float) nounwind<br class="gmail_msg">
+declare float @floorf(float) nounwind<br class="gmail_msg">
+declare float @fmodf(float, float) nounwind<br class="gmail_msg">
+declare float @logf(float) nounwind<br class="gmail_msg">
+declare float @log10f(float) nounwind<br class="gmail_msg">
+declare float @powf(float, float) nounwind<br class="gmail_msg">
+declare float @sinf(float) nounwind<br class="gmail_msg">
+declare float @sinhf(float) nounwind<br class="gmail_msg">
+declare float @sqrtf(float) nounwind<br class="gmail_msg">
+declare float @tanf(float) nounwind<br class="gmail_msg">
+declare float @tanhf(float) nounwind<br class="gmail_msg">
+<br class="gmail_msg">
+define void @T() {<br class="gmail_msg">
+entry:<br class="gmail_msg">
+; CHECK-LABEL: @T(<br class="gmail_msg">
+; CHECK-NEXT: entry:<br class="gmail_msg">
+<br class="gmail_msg">
+; log(0) produces a pole error<br class="gmail_msg">
+; CHECK-NEXT: %log1 = call double @log(double 0.000000e+00)<br class="gmail_msg">
+  %log1 = call double @log(double 0.000000e+00)<br class="gmail_msg">
+<br class="gmail_msg">
+; log(-1) produces a domain error<br class="gmail_msg">
+; CHECK-NEXT: %log2 = call double @log(double -1.000000e+00)<br class="gmail_msg">
+  %log2 = call double @log(double -1.000000e+00)<br class="gmail_msg">
+<br class="gmail_msg">
+; log(1) is 0<br class="gmail_msg">
+  %log3 = call double @log(double 1.000000e+00)<br class="gmail_msg">
+<br class="gmail_msg">
+; exp(100) is roughly 2.6e+43<br class="gmail_msg">
+  %exp1 = call double @exp(double 1.000000e+02)<br class="gmail_msg">
+<br class="gmail_msg">
+; exp(1000) is a range error<br class="gmail_msg">
+; CHECK-NEXT: %exp2 = call double @exp(double 1.000000e+03)<br class="gmail_msg">
+  %exp2 = call double @exp(double 1.000000e+03)<br class="gmail_msg">
+<br class="gmail_msg">
+; cos(0) is 1<br class="gmail_msg">
+  %cos1 = call double @cos(double 0.000000e+00)<br class="gmail_msg">
+<br class="gmail_msg">
+; cos(inf) is a domain error<br class="gmail_msg">
+; CHECK-NEXT: %cos2 = call double @cos(double 0x7FF0000000000000)<br class="gmail_msg">
+  %cos2 = call double @cos(double 0x7FF0000000000000)<br class="gmail_msg">
+<br class="gmail_msg">
+; pow(0, 1) is 0<br class="gmail_msg">
+  %pow1 = call double @pow(double 0x7FF0000000000000, double 1.000000e+00)<br class="gmail_msg">
+<br class="gmail_msg">
+; pow(0, -1) is a pole error<br class="gmail_msg">
+; CHECK-NEXT: %pow2 = call double @pow(double 0.000000e+00, double -1.000000e+00)<br class="gmail_msg">
+  %pow2 = call double @pow(double 0.000000e+00, double -1.000000e+00)<br class="gmail_msg">
+<br class="gmail_msg">
+; fmod(inf, nan) is nan<br class="gmail_msg">
+  %fmod1 = call double @fmod(double 0x7FF0000000000000, double 0x7FF0000000000001)<br class="gmail_msg">
+<br class="gmail_msg">
+; fmod(inf, 1) is a domain error<br class="gmail_msg">
+; CHECK-NEXT: %fmod2 = call double @fmod(double 0x7FF0000000000000, double 1.000000e+00)<br class="gmail_msg">
+  %fmod2 = call double @fmod(double 0x7FF0000000000000, double 1.000000e+00)<br class="gmail_msg">
+<br class="gmail_msg">
+; CHECK-NEXT: ret void<br class="gmail_msg">
+  ret void<br class="gmail_msg">
+}<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
llvm-commits mailing list<br class="gmail_msg">
<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="gmail_msg">
</blockquote></div><br class="gmail_msg"></div>
_______________________________________________<br class="gmail_msg">
llvm-commits mailing list<br class="gmail_msg">
<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="gmail_msg">
</blockquote></div></div></div></blockquote></div>