<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 1, 2014 at 9:29 PM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">> Do you know why? At least for the empty case it should be valid to<br></div><div class="">
> drop constructors of any priority.<br>
<br>
</div>I don't know. Constructors with init priority are rare, and empty<br>
constructors with init priority are probably rarer still though.</blockquote><div><br></div><div>llvm.global_ctors is unordered, which is what allows globalopt to run only some of the ctors without worrying about changing program semantics because it statically initialized something before dynamically running one of the ctors it couldn't optimize.</div>
<div><br></div><div>If the ctors aren't all standard priority, globalopt would have to carefully only evaluate ctors with high priority, and if any remain after optimization, stop optimization there, because the remaining ones run first.</div>
</div></div></div>