[PATCH] Fix pow simplification when fabs and sqrt are unavailable

Eli Friedman eli.friedman at gmail.com
Thu Aug 15 15:17:31 PDT 2013


While you're here, you might as well fix the calls to EmitUnaryFloatFnCall
to get the function name from TLI as well.

-    if (ConstantFP *Op1C = dyn_cast<ConstantFP>(Op1)) {
+    ConstantFP *Op1C = dyn_cast<ConstantFP>(Op1);
+    if (Op1C) {

Why are you reformatting this?

-Eli


On Thu, Aug 15, 2013 at 6:20 AM, Kuperstein, Michael M <
michael.m.kuperstein at intel.com> wrote:

>  Whoops, previous patch is bad.****
>
> Attached is a hopefully saner one.****
>
> ** **
>
> (Also adds a missing check for pow(2.0, x) -> exp2(x) **correctly**,
> that’s unrelated to the ldexp issue.)****
>
> ** **
>
> *From:* Kuperstein, Michael M
> *Sent:* Thursday, August 15, 2013 16:10
> *To:* llvm-commits at cs.uiuc.edu
> *Subject:* [PATCH] Fix pow simplification when fabs and sqrt are
> unavailable****
>
> ** **
>
> Hi,****
>
> ** **
>
> This adds a missing TLI check for the pow(x, 0.5) -> fabs(sqrt(x))
> simplification.****
>
> ** **
>
> There’s a similar problem with exp2, but I don’t see a LibFunc::ldexp I
> can check for. ****
>
> Anyone has any idea if it’s missing on purpose, or just an omission? ****
>
> ** **
>
> Michael****
>
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130815/845c9b26/attachment.html>


More information about the llvm-commits mailing list