<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 Jul 17, 2015, at 5:26 PM, Bob Wilson <<a href="mailto:bob.wilson@apple.com" class="">bob.wilson@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jul 15, 2015, at 10:30 PM, Eric Christopher <<a href="mailto:echristo@gmail.com" class="">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Bob,<div class=""><br class=""></div><div class="">I think the calling convention patch is fairly obviously ok. The bar is usually a little higher for things like attributes and flags, any hope for a bit more explanation there?</div></div></div></blockquote><div class=""><br class=""></div>Sure. While I’m at it, I should correct my previous remark about bitcode compatibility with Xcode 7. The Swift calling convention at issue here is still under development. I don’t know when it will be released. That said, people are working on it and it will help us to reserve these values and avoid bitcode conflicts.</div><div class=""><br class=""></div><div class="">Swift has two special cases for argument passing: self/context pointers and an extra error result. These are orthogonal to other arguments, and a function may have either or both of these special cases.</div><div class=""><br class=""></div><div class="">* The “swiftself” attribute identifies an argument as the special “self” pointer (or the context for a closure). We pass this argument in a special dedicated register, at least for targets that have a register that can be used for that.</div><div class=""><br class=""></div><div class="">* With Swift error handling, there is an extra return value that is returned in a special dedicated register (for targets that can support that). We represent this in LLVM IR using an argument with an extra level of indirection, kind of like what we do for “byval” arguments. There is a “swifterror" attribute on that argument. The IR for the function sets the error result by storing to that argument, but we actually generate code that returns the value directly in the dedicated register. There is also an attribute on the caller’s alloca that represents the error return value, since it is special in various ways, e.g., the value passed in doesn’t matter and doesn’t need to be initialized because it is really only a return value.</div><div class=""><br class=""></div><div class="">Does that make sense?</div></div></div></blockquote><div><br class=""></div>Ping.</div><div><br class=""></div><div>Eric, did you have any more concerns here? We should discuss this in more depth when the implementation of this calling convention can be shared. Reserving the constants now doesn’t hurt anything, does it? Even if we somehow end up with a different implementation later, we could free up those attribute values for other purposes at that time and we wouldn’t be any worse off than we would be otherwise.</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Thanks!</div><div class=""><br class=""></div><div class="">-eric</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Wed, Jul 15, 2015 at 3:57 PM Bob Wilson <<a href="mailto:bob.wilson@apple.com" class="">bob.wilson@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As announced at WWDC, we are in the process of open-sourcing the Swift compiler. In anticipation of that, I would like to apply the attached patch to reserve some constant values to avoid incompatible bitcode between Apple’s current Swift compiler and trunk. Swift has a custom calling convention that also requires some new flags on arguments and one new attribute on alloca instructions. This patch does not include the implementation of that calling convention — that will be provided as part of the open-source release of Swift; this only reserves the bitcode constant values so that they are not used for other purposes on trunk, which would make it impossible for people to use bitcode from the Xcode 7 Swift compiler with the version that we release as open-source.<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></body></html>