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

Kuperstein, Michael M michael.m.kuperstein at intel.com
Sun Aug 18 08:19:29 PDT 2013


All of the Emit functions in BuildLibCalls.cpp use hardcoded names internally.
I guess it's a good idea to change all of that, but probably not in this commit.

The reformatting was a mistake, it was needed in the broken version of the patch because I added a condition in the same if Op1C was defined in, changed it back, thanks.
(The comment reformatting is due to overlong lines)

Does it look ok now?

Michael

From: Eli Friedman [mailto:eli.friedman at gmail.com]
Sent: Friday, August 16, 2013 01:18
To: Kuperstein, Michael M
Cc: llvm-commits at cs.uiuc.edu
Subject: Re: [PATCH] Fix pow simplification when fabs and sqrt are unavailable

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<mailto: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<mailto: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<mailto:llvm-commits at cs.uiuc.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

---------------------------------------------------------------------
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130818/3e56e77b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: powtli3.diff
Type: application/octet-stream
Size: 2940 bytes
Desc: powtli3.diff
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130818/3e56e77b/attachment.obj>


More information about the llvm-commits mailing list