[LLVMdev] Pure external functions

Jon Harrop jon at ffconsultancy.com
Tue Feb 17 02:37:28 PST 2009


On Tuesday 17 February 2009 09:46:07 Duncan Sands wrote:
> Hi,
>
> > Lennart Augustsson mentioned on his blog that he got substantial
> > performance improvements by conveying to LLVM when external functions
> > (e.g. tanh) were pure.
>
> first note that tanh is not pure, because the result depends on the current
> floating point rounding mode.

Ugh.

> However, if you are willing to sacrifice 
> complete numerical correctness, you can give llvm-gcc the -ffast-math flag
> and, voila!, tanh becomes pure.

How do you do the equivalent from the JIT?

-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e



More information about the llvm-dev mailing list