<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'>Hi Reid, Eric,<br><br>I'd like to come back to this idea of splitting out interposible into its own bit separate from the base linkage type. I'm still not convinced that I see any structural advantage to doing this...<br><br>Generally, the advantage of this kind of splitting is orthogonality, but there isn't much to be gained: We currently have four interposible linkage types (out of 11), and after this change we'll have five. For the others, we need to add validation code and diagnostics to disallow the forbidden combinations. Plus, two of these must be interposible (which means more validation code and diagnostics). <br><br>On top of that, we'll lose an available subclass bit in GlobalValue: We currently use 4 bits to store the linkage type (as there are 11 of them). Adding one will fit in the same number of bits. But only two get removed if we factor out the interposibility, so we still need 4 bits for the base linkage type plus one more for the interposible bit. In short, because so few of the potential combinations are permitted, separating out interposibility will make our encoding less efficient. For backwards compatibility at the bitcode level, we'd need to do this anyway (i.e. explicitly represent the combined value set in one unified encoding space).<br><br>In addition, there's engineering effort involved in updating APIs, etc. (mostly for me, but for everyone else too). I'm certainly willing to do that if we want to go down this route. Maybe I'm just missing some bigger-picture advantages.<br><br>Thanks again,<br>Hal<br><br><hr id="zwchr"><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Reid Kleckner" <rnk@google.com><br><b>To: </b>"Hal Finkel" <hfinkel@anl.gov><br><b>Cc: </b>"Eric Christopher" <echristo@gmail.com>, "llvm-dev" <llvm-dev@lists.llvm.org><br><b>Sent: </b>Tuesday, November 29, 2016 12:37:32 PM<br><b>Subject: </b>Re: [llvm-dev] RFC: Add an "interposible" linkage type (and implement -fsemantic-interposition)<br><br><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 29, 2016 at 10:02 AM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">So we're all on the same page, our current encodings are:<br><br>External: 0<br>WeakAny: 16<br>Appending: 2<br>Internal: 3<br>LinkOnceAny: 18<br>ExternalWeak: 7<br>Common: 8<br>Private: 9<br>WeakODR: 17<br>LinkOnceODR: 19<br>AvailableExternally: 12<br><br>And the new encodings would be:<br><br>
External: 0<br>External + Interposible: 20<br>
Weak + Interposible: 16<br>
Appending: 2 [interposible N/A]<br>
Internal: 3 [never interposible]<br>
LinkOnce + Interposible: 18<br>
ExternalWeak: 7 [always interposible]<br>
Common: 8 [interposible N/A]<br>
Private: 9 [never interposible]<br>
Weak: 17<br>
LinkOnce: 19<br>
AvailableExternally: 12 [never interposible]<br><br>With the mappings:<br><br>[Old] -> [New]<br>External -> External<br>WeakAny -> Weak + Interposible<br>LinkOnceAny -> LinkOnce + Interposible<br>WeakODR -> Weak<br>LinkOnceODR -> LinkOnce<br><br>Is this what you had in mind?<br><br>Thanks again,<br>Hal</div></div></blockquote><div><br></div><div>Exactly!</div><div><br></div><div>The verifier should check that users aren't making invalid things like interposable internal/available_externally functions.</div><div><br></div><div>I'm not exactly sure when ExternalWeak applies and how we should model its interposability. I guess it would always be interposable to avoid special cases.</div></div></div></div>
</blockquote><br><br><br>-- <br><div><span name="x"></span>Hal Finkel<br>Lead, Compiler Technology and Programming Languages<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></div></body></html>