<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 24, 2014 at 6:46 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">> I conceptually agree, but I think that's an issue beyond this optimization.<br>
> I think this patch LGTM, Rafael?<br>
<br>
</div>Almost. Please include a corresponding change to the LangRef. Just<br>
state which calling conventions can or cannot cannot be changed when<br>
the target function is internal or private.<br></blockquote><div><br></div><div>I don't think we should give an explicit list based on what GlobalOpt does today, because it will change.</div><div><br></div><div>Ultimately, if users want to preserve the calling convention of internal functions, they should use llvm.used / compiler_used.  I just don't want to break them right now.</div>
<div><br></div><div>If we update LangRef, I would say that optimizers are allowed to change calling conventions of functions if it can simultaneously update all possible callers.  But, even that feels too specific. It's generally implied that LLVM's optimizers can do anything that the user can't observer, and this feels pretty close to that.</div>
</div></div></div>