[LLVMdev] sincos optimization

Redmond, Paul paul.redmond at intel.com
Tue Jan 22 10:52:40 PST 2013


Hi David,

On 2013-01-22, at 5:59 AM, David Given wrote:

> ...and the code that actually does it is here:
> 
> 	lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
> 
> Look for SelectionDAGBuilder::visitUnaryFloatCall() and visitCall().
> 
> It appears that such functions are only promoted if they're declared
> readnone, which provides some protection against overriding a standard
> library function, but I haven't found anything that explicitly checks
> for this yet.
> 

Thanks for the tip. I am able to see sinf to FSIN generation when I compile with -ffast-math.

I don't have much experience with the selection dag but I feel like this transformation shouldn't be done at this level (it's more complicated than the transformations done by SelectionDAGCombine)

Would it make sense to move library call to intrinsic generation to the IR level?

paul





More information about the llvm-dev mailing list