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

Stephen Canon scanon at apple.com
Mon Nov 26 11:33:06 PST 2012


In the scenario you describe, wouldn't TLI->has(LibFunc::exp2) be true because the target has an exp2 (which calls pow(2,x))?

- Steve

On Nov 26, 2012, at 2:17 PM, 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
> <Libcalls.diff>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list