[LLVMdev] removing dead function calls

Chris Lattner clattner at apple.com
Sun Jul 25 10:14:47 PDT 2010

On Jul 25, 2010, at 6:48 AM, Jochen Wilhelmy wrote:

> Hi!
> I have code with dead function calls which are not removed. Is it possible
> to mark functions that have no side effects (e.g. sin() or floor() ) so 
> that they
> are removed by dead code elimination?

Yep, just add the readonly/readnone attributes to the call site or function and they should be deleted if dead.  See LangRef.html for more info.


More information about the llvm-dev mailing list