<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt">on Jan  6, 2011  9:21 pm Christophe de Dinechin wrote:<br>>On 7 janv. 2011, at 01:00, Duncan Sands wrote:
<a href="http://markmail.org/message/2y3g54ic4nl4jcnh"> </a> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div class="quote quote-1"><div> >>That said, probably the reason you are getting improved optimization is due to<br>>>running the "internalize" pass. If so be warned that it is not safe to run<br>>>internalize unless all functions and their bodies are present in the module. <br></div><div><br></div></div><div>
>All functions and bodies are present, so that's not the issue. The issue is that<br>>some inputs of LTO are destroyed as a side effect of running it.

</div><div class="quote quote-1"><div><br></div><div>>>If you run internalize, optimize, and then later add a few more functions to the<br>>>module all kinds of nasty subtle things can go wrong, not just those you saw<br>>>with GlobalDCE.
</div></div><div><br>
</div><div>>Do you mean I should assume for example that the Functions I generated are also<br>>irreversibly damaged? If so, what passes do I need to avoid if I want to<br>>preserve the ability to do incremental recompilation?</div><div><br></div><div><br></div><div>First of all, Sorry for waking up this zombie thread from jan 2011, but i'm investigating incremental compilation</div><div>and i haven't found much else besides this.</div><div><br></div><div>As a question to Christophe, but also to anyone that might help; are your functions being</div><div>evicted from the final module after LTO *even* if the functions are created with External Linkage?</div><div><br></div><div>notice the following points:<br></div><div><br></div><div>1) my understanding is that a function with external linkage should be always available. That is</div><div>how libraries export their symbols after all.<br></div><div><br></div><div>2) my understanding also (and this
 is the crucial point) is that LTO as a optimization phase should</div><div>be equally applicable to final executables or libraries. Libraries always should have their <br></div><div>export/external symbols available even if they seem to not be called from inside the available code.</div><div>(libraries would be very useless objects after all!). This does not (or *should not*) preclude</div><div>LTO optimization of the library dependencies</div><div><br></div><div>am i making sense here?</div><div><br></div><div>thanks!</div><div><br></div><div><br>

</div> </div>  </div></body></html>