[LLVMdev] DCE and external function

Mahadevan R mdevan.foobar at gmail.com
Tue Oct 12 22:45:06 PDT 2010


Hi,

On Mon, Oct 11, 2010 at 3:46 PM, Duncan Sands <baldrick at free.fr> wrote:
> 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).

Wasn't there some efforts/investigation to support marking
of (body-less) functions as 'pure'? Is this on the roadmap?

Cheers,
-Mahadevan.



More information about the llvm-dev mailing list