<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Sep 12, 2016 at 6:01 PM Robinson, Paul <<a href="mailto:paul.robinson@sony.com">paul.robinson@sony.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple" class="gmail_msg">
<div class="m_-8606035682448503423WordSection1 gmail_msg">
<p class="MsoNormal gmail_msg"><a name="m_-8606035682448503423__MailEndCompose" class="gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg">The text in the committee draft is different (e.g., the exhortation about non-default alignment is gone), with an example to the effect
 that a value of 8 means the entity's address is a multiple of 8 (not 2^8).  So, alignment is conceived in terms of address bits, whatever those represent (not always bytes). </span></a></p></div></div></blockquote><div>Not sure I quite follow. OK, so in an octet addressable world (which LLVM is - there have been some attempts to support non-octet addressing, but I don't think any have been near to successful) then DW_AT_alignment is byte alignment (1 means there are no zero bits in the address, 2 means there's 1 trailing zero bit in the address, etc).<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple" class="gmail_msg"><div class="m_-8606035682448503423WordSection1 gmail_msg">
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg">If Clang is being infested with more target knowledge, okay, but that means tolerating the weirder targets in these cases.  Dividing by CHAR_BITS makes an assumption
 that isn't necessarily correct.</span></p></div></div></blockquote><div>Clang has the knowledge already - it knows the alignment of the types its allocating, etc. So I'm not sure what infestation you're referring to.<br><br>I've sort of lost track of what we're discussing here.<br><br>Essentially what I'm suggesting is that Clang should put whatever number is going to go in the DWARF, into the metadata. I don't believe the LLVM backends have greater knowledge than the frontend does in this domain - have I missed something there, are there examples where that could/would be true?<br><br>- David</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple" class="gmail_msg"><div class="m_-8606035682448503423WordSection1 gmail_msg"><p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg"><u class="gmail_msg"></u><u class="gmail_msg"></u></span></p>
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg">--paulr<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p>
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg">P.S. The committee is hoping to get a draft out for public comment Real Soon Now.</span></p></div></div></blockquote><div>Looking forward to it :) </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple" class="gmail_msg"><div class="m_-8606035682448503423WordSection1 gmail_msg"><p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg"><u class="gmail_msg"></u><u class="gmail_msg"></u></span></p>
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt" class="gmail_msg">
<div class="gmail_msg">
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in" class="gmail_msg">
<p class="MsoNormal gmail_msg"><b class="gmail_msg"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" class="gmail_msg">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" class="gmail_msg"> cfe-commits [mailto:<a href="mailto:cfe-commits-bounces@lists.llvm.org" class="gmail_msg" target="_blank">cfe-commits-bounces@lists.llvm.org</a>]
<b class="gmail_msg">On Behalf Of </b>David Blaikie via cfe-commits<br class="gmail_msg">
<b class="gmail_msg">Sent:</b> Monday, September 12, 2016 5:12 PM<br class="gmail_msg">
<b class="gmail_msg">To:</b> <a href="mailto:reviews%2BD24426%2Bpublic%2B6ee6274d38fdf0d6@reviews.llvm.org" class="gmail_msg" target="_blank">reviews+D24426+public+6ee6274d38fdf0d6@reviews.llvm.org</a>; <a href="mailto:vleschuk@accesssoftek.com" class="gmail_msg" target="_blank">vleschuk@accesssoftek.com</a>; <a href="mailto:echristo@gmail.com" class="gmail_msg" target="_blank">echristo@gmail.com</a>; <a href="mailto:aprantl@apple.com" class="gmail_msg" target="_blank">aprantl@apple.com</a>; <a href="mailto:mehdi.amini@apple.com" class="gmail_msg" target="_blank">mehdi.amini@apple.com</a><br class="gmail_msg">
<b class="gmail_msg">Cc:</b> <a href="mailto:cfe-commits@lists.llvm.org" class="gmail_msg" target="_blank">cfe-commits@lists.llvm.org</a><br class="gmail_msg">
<b class="gmail_msg">Subject:</b> Re: [PATCH] D24426: DebugInfo: Pass non-zero alignment to DIBuilder only if aligment was forced<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p>
</div>
</div></div></div></div><div lang="EN-US" link="blue" vlink="purple" class="gmail_msg"><div class="m_-8606035682448503423WordSection1 gmail_msg"><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt" class="gmail_msg">
<p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p>
<div class="gmail_msg">
<p class="MsoNormal gmail_msg" style="margin-bottom:12.0pt"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p>
<div class="gmail_msg">
<div class="gmail_msg">
<p class="MsoNormal gmail_msg">On Mon, Sep 12, 2016 at 5:00 PM Paul Robinson <<a href="mailto:paul.robinson@sony.com" class="gmail_msg" target="_blank">paul.robinson@sony.com</a>> wrote:<u class="gmail_msg"></u><u class="gmail_msg"></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in" class="gmail_msg">
<p class="MsoNormal gmail_msg">probinson added a subscriber: probinson.<br class="gmail_msg">
<br class="gmail_msg">
================<br class="gmail_msg">
Comment at: lib/CodeGen/CGDebugInfo.cpp:3691<br class="gmail_msg">
@@ -3635,1 +3690,3 @@<br class="gmail_msg">
+  if (D->hasAttr<AlignedAttr>())<br class="gmail_msg">
+    AlignInBits = D->getMaxAlignment();<br class="gmail_msg">
   StringRef DeclName, LinkageName;<br class="gmail_msg">
----------------<br class="gmail_msg">
dblaikie wrote:<br class="gmail_msg">
> is max alignment the right thing here? Should it be min alignment?<br class="gmail_msg">
> (is alignment in bits the desired thing across all of this too? It looked like in the backend patch there was some division by CHAR_BITS, etc?)<br class="gmail_msg">
I should think bits is the right choice here; seems more the province of the backend to convert it into the appropriate addressable units (commonly but not universally chars).<u class="gmail_msg"></u><u class="gmail_msg"></u></p>
</blockquote>
<div class="gmail_msg">
<p class="MsoNormal gmail_msg"><br class="gmail_msg">
The alternative thinking is that we've a generally sense we want to make more of this type information opaque to LLVM - so I'm somewhat inclined to make the frontend do the work of choosing what to emit and the backend just being as simple as possible.<br class="gmail_msg">
<br class="gmail_msg">
Hmm, seems like the DWARF spec details I can find: <a href="http://www.dwarfstd.org/ShowIssue.php?issue=140528.1" class="gmail_msg" target="_blank">http://www.dwarfstd.org/ShowIssue.php?issue=140528.1</a> don't really specify what the value of DW_AT_alignment is, it's sort of assumed, by the
 looks of it? I'm assuming it's bytes, the same as the byte_size attribute.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
 <u class="gmail_msg"></u><u class="gmail_msg"></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in" class="gmail_msg">
<p class="MsoNormal gmail_msg" style="margin-bottom:12.0pt"><br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D24426" class="gmail_msg" target="_blank">https://reviews.llvm.org/D24426</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<u class="gmail_msg"></u><u class="gmail_msg"></u></p>
</blockquote>
</div>
</div>
</div></div></div></blockquote></div></div>