[LLVMdev] constant folding for standard math functions

Chris Lattner clattner at apple.com
Mon Mar 1 11:13:31 PST 2010


On Mar 1, 2010, at 9:44 AM, Jochen Wilhelmy wrote:

> Hi!
> 
> I'd like to replace all calls to standard math functions (e.g. sin(0.5)) by
> their result.
> What strategy do you recommend?
> Should I write a pass that does only this or should I copy and
> modify the SCCP pass?
> 
> A problem with an extra pass could be that that I need to alternate
> my pass and SCCP several times since the results of the math functions
> could be folded again.

sin/cos etc should already be handled by lib/Analysis/ConstantFolding.cpp.

-Chris



More information about the llvm-dev mailing list