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

Eli Friedman eli.friedman at gmail.com
Mon Nov 26 13:02:44 PST 2012


On Mon, Nov 26, 2012 at 11:17 AM, Derek Schuff <dschuff at google.com> wrote:
> Hi,
> Attached is a patch to check that exp2 is available using the usual
> TLI mechanism before optimizing pow(2.0, x) to exp2(x). This is a
> problem if compiling a math library that implements exp2(x) as a call
> to pow(2,x).
>
> please review, thanks

Please include a testcase in all patches.  (See
http://llvm.org/docs/DeveloperPolicy.html .)  Probably the right place
to put in a test is
test/Transforms/InstCombine/disable-simplify-libcalls.ll .

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.

-Eli



More information about the llvm-commits mailing list