[LLVMdev] DCE and external function

Duncan Sands baldrick at free.fr
Mon Oct 11 03:16:50 PDT 2010


Hi leledumbo,

> If I have:
>
> %x = call @externalFunc
> ... ; other codes where %x is not used
> ret ; assume void function
>
> and use dce optimization, will the call gets eliminated?

only if the compiler can prove that the called function has
no side effects (such as modifying some global variables or
causing the program to exit).

Ciao,

Duncan.



More information about the llvm-dev mailing list