[llvm-commits] [PATCH] Instcombine: Don't optimize pow(2.0, x) -> exp2(x) if exp2 is unavailable

Derek Schuff dschuff at google.com
Tue Nov 27 16:52:32 PST 2012


To solve the problem of modifying the implementation of library
functions during LTO, here is one solution:
don't modify the implementation of library functions. It's not
normally necessary since LTO doesn't always include the C library, but
it seems like a reasonable thing to do in any case. attached is a
patch.

On Tue, Nov 27, 2012 at 4:20 PM, Derek Schuff <dschuff at google.com> wrote:
> OK, thanks for the feedback.
> Attached is a patch which fixes the problem of emitting the pow
> optimizations on platforms which lack exp2 et al, along with tests.
> The optimizations which are added via addOpt are properly guarded, so
> mostly just the pow and exp2 opts needed work. A patch for my specific
> problem is forthcoming.
>
> On Mon, Nov 26, 2012 at 6:18 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>> On Mon, Nov 26, 2012 at 3:33 PM, Derek Schuff <dschuff at google.com> wrote:
>>> On Mon, Nov 26, 2012 at 1:02 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>>>> On Mon, Nov 26, 2012 at 11:17 AM, Derek Schuff <dschuff at google.com> wrote:
>>>> The patch is fine, as far as it goes.  There are a bunch of related
>>>> issues here, if you're interested in trying to address them.
>>> What did you have in mind?
>>> As long as I'm in this code, I don't mind fixing some things, as long
>>> as the rabbit hole's not *too* deep :)
>>
>> Every other call to EmitUnaryFloatFnCall is broken in the same way.
>>
>> -Eli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Libcalls-libraries.diff
Type: application/octet-stream
Size: 1342 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121127/91f34c82/attachment.obj>


More information about the llvm-commits mailing list