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

Owen Anderson resistor at mac.com
Mon Nov 26 11:37:10 PST 2012


The build system for the library should be passing -fno-builtin-exp2 (or something similar).

--Owen

On Nov 26, 2012, at 11:33 AM, Stephen Canon <scanon at apple.com> wrote:

> 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
> 
> _______________________________________________
> 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