<div dir="ltr">Thanks David !<div>Appreciate the guidance. :)</div><div><br></div><div>Ill go through the internalize pass , hopefully that should also give me an idea to find the entry point .</div><div><br></div><div>Thanks </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 25, 2017 at 2:07 PM, David Chisnall <span dir="ltr"><<a href="mailto:David.Chisnall@cl.cam.ac.uk" target="_blank">David.Chisnall@cl.cam.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 25 Oct 2017, at 05:34, mohie pokhriyal <<a href="mailto:mohie10@gmail.com">mohie10@gmail.com</a>> wrote:<br>
><br>
> Thank You David and Mats for the reply,<br>
><br>
> The reason I need to know that main is the entry point is as follows :<br>
><br>
> I have a dead code elimination pass that removes the function call for boo. boo was initially called from the main function , but since the return in the main function has no dependency on boo, boo function call is removed.<br>
<br>
</span>This is not sound. The linkage of boo means that it is externally visible. There is no guarantee that it will not be called from another compilation unit. If boo had internal or private linkage, then you would be safe to delete it as soon as its uses count dropped to zero (and LLVM’s dead code elimination pass will do exactly that).<br>
<br>
If you run the Internalize pass first, then it will mark functions that are not reachable from main as internal and then DCE can delete them.<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
<br>
</font></span></blockquote></div><br></div>