[LLVMdev] "pure" functions"

Chris Lattner sabre at nondot.org
Sun Jun 4 09:49:53 PDT 2006


On Sun, 4 Jun 2006, Vladimir Prus wrote:
> say I've a LLVM module with a call instruction. The called function is
> "pure", that is it has no side-effects at all. How can I communicate this
> to LLVM, so that the function call can be removed if the return value is
> never used?

There isn't a way to do this from the source code yet.  However, if this 
is a standard library function, you can add it to the end of 
lib/Analysis/BasicAliasAnalysis.cpp.  Search of "isspace".

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list