[LLVMdev] sincos optimization

Redmond, Paul paul.redmond at intel.com
Mon Jan 21 21:30:10 PST 2013


Hi,

I'm looking at http://llvm.org/bugs/show_bug.cgi?id=13204 which involves converting calls to sin and cos to sincos (when available)

Initially I thought about transforming calls to sinf/cosf to sincosf. However, I don't think this is a legal transformation given that a declaration for a function called sinf is not necessarily the standard library function.

Therefore it makes sense to transform intrinsic calls to sin and cos. One problem with this is that clang does not generate sin/cos intrinsics because they do not have the same semantics as the library functions.

What is the best way to approach this transformation?

(Also, experimentation shows that sincos is indeed faster than sin and cos)

paul










More information about the llvm-dev mailing list