[PATCH] D22104: [SimplifyLibCalls] pow(x, 0.5) -> fabs(sqrt(x)) (finite-only-mode)

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 12:03:35 PDT 2016


Hi,

Am I being stupid? Why are you taking the absolute value of a square root -
this should always be positive?

James

On Thu, 7 Jul 2016 at 19:55 David Majnemer via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> majnemer added inline comments.
>
> ================
> Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1071
> @@ +1070,3 @@
> +        emitUnaryFloatFnCall(Sqrt, "fabs", B, Callee->getAttributes());
> +    if (isFiniteMathMode(F))
> +      return FAbs;
> ----------------
> Hmm.  Why not check to see if the call-site is annotated with `ninf nnan`?
>
>
> http://reviews.llvm.org/D22104
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160707/c467f6ca/attachment.html>


More information about the llvm-commits mailing list