<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 6, 2017, at 11:50 AM, Andrew Kelley via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 6, 2017 at 12:36 PM, Tim Northover <span dir="ltr" class=""><<a href="mailto:t.p.northover@gmail.com" target="_blank" class="">t.p.northover@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 5 February 2017 at 23:41, Andrew Kelley via llvm-dev<br class="">
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class="">
> Target: armv7<br class="">
<br class="">
On a debug compiler it looks like only x86 supports "coldcc" so you<br class="">
need to either implement ARM support or stop using that.<br class=""></blockquote><div class=""><br class=""></div>Thanks Tim and apologies for my sloppy bug report.<div class=""><br class=""></div><div class="">Here is the text from the <a href="http://llvm.org/docs/LangRef.html#calling-conventions" target="_blank" class="">language reference</a>:</div><div class=""><br class=""></div><div class=""><div class="">“coldcc” - The cold calling convention</div><div class="">This calling convention attempts to make code in the caller as efficient as possible under the assumption that the call is not commonly executed. As such, these calls often preserve all registers so that the call does not break any live ranges in the caller side. This calling convention does not support varargs and requires the prototype of all callees to exactly match the prototype of the function definition. Furthermore the inliner doesn’t consider such function calls for inlining.</div><div class=""><br class=""></div></div><div class="">The phrasing of "attempts", "often", and the fact that it provides hints to the inliner makes it sound like coldcc is:</div><div class=""><br class=""></div><div class=""> * useful for optimization purposes regardless of an ABI</div></div></div></div></div></blockquote><div><br class=""></div><div>I’d rather decouple the calling convention from the IR optimization. We already have a function attribute to mark function cold (and that’s what is used by __attribute__((cold)) AFAIK). A single source of truth is preferable here.</div><div>So I’d change LangRef to make it clear, and maybe update the pass that deduce function attribute to mark the attribute `cold` when coldcc is present.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> * not necessarily the same ABI on every target - and some ABI will be chosen even if it is just the c calling convention<br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>