<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>Hello Patrik,</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>Thank you for your reply. Indeed, setting the alignment using the constructor is sufficient. <br></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;">Regards,<br><span></span></div><div style="color: rgb(0, 0, 0); font-size:
13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>Alexandra<br></span></div><div><br></div> <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Patrik Hägglund H <patrik.h.hagglund@ericsson.com><br> <b><span style="font-weight: bold;">To:</span></b> Jimborean Alexandra <xinfinity_a@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "llvmdev@cs.uiuc.edu" <llvmdev@cs.uiuc.edu> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, November 22, 2012 1:47 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> RE: [LLVMdev] Set the minimum number of allocated bits for a variable<br> </font> </div> <br>
<div id="yiv1254029591">
<style><!--
#yiv1254029591
_filtered #yiv1254029591 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}
_filtered #yiv1254029591 {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
#yiv1254029591
#yiv1254029591 p.yiv1254029591MsoNormal, #yiv1254029591 li.yiv1254029591MsoNormal, #yiv1254029591 div.yiv1254029591MsoNormal
{margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", "serif";}
#yiv1254029591 a:link, #yiv1254029591 span.yiv1254029591MsoHyperlink
{color:blue;text-decoration:underline;}
#yiv1254029591 a:visited, #yiv1254029591 span.yiv1254029591MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
#yiv1254029591 span.yiv1254029591EmailStyle17
{font-family:"Calibri", "sans-serif";color:#1F497D;}
#yiv1254029591 .yiv1254029591MsoChpDefault
{font-size:10.0pt;}
_filtered #yiv1254029591 {margin:72.0pt 72.0pt 72.0pt 72.0pt;}
#yiv1254029591 div.yiv1254029591WordSection1
{}
--></style>
<div>
<div class="yiv1254029591WordSection1">
<div class="yiv1254029591MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">Hi Alexandra,</span></div>
<div class="yiv1254029591MsoNormal"><span style="font-size:11.0pt;color:#1F497D;"> </span></div>
<div class="yiv1254029591MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">I’m not sure want you want to do. Is the data layout string (http://llvm.org/docs/LangRef.html#datalayout,
also usually set by each target specific *TargetMachine constructor), for setting the alignment good enough for you?</span></div>
<div class="yiv1254029591MsoNormal"><span style="font-size:11.0pt;color:#1F497D;"> </span></div>
<div class="yiv1254029591MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">Or is it more than the alignment you want to control? Do you have a target with 16-bit bytes? In that case, there is quite a lot of changes that needs to be
done (we maintain some patches internally that we can provide upon request).</span></div>
<div class="yiv1254029591MsoNormal"><span style="font-size:11.0pt;color:#1F497D;"> </span></div>
<div class="yiv1254029591MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">Regards,</span></div>
<div class="yiv1254029591MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">Patrik Hägglund</span></div>
<div class="yiv1254029591MsoNormal"><span style="font-size:11.0pt;color:#1F497D;"> </span></div>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm;">
<div class="yiv1254029591MsoNormal"><b><span style="font-size:10.0pt;">From:</span></b><span style="font-size:10.0pt;"> llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu]
<b>On Behalf Of </b>Jimborean Alexandra<br>
<b>Sent:</b> den 22 november 2012 13:07<br>
<b>To:</b> llvmdev@cs.uiuc.edu<br>
<b>Subject:</b> [LLVMdev] Set the minimum number of allocated bits for a variable</span></div>
</div>
</div>
<div class="yiv1254029591MsoNormal"> </div>
<div>
<div>
<div class="yiv1254029591MsoNormal" style="background:white;"><span style="font-size:10.0pt;color:black;">Hi,</span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal" style="background:white;"><span style="font-size:10.0pt;color:black;"> </span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;">I would like to force the minimum number of bits allocated for a variable in memory to be 16. From what I have seen, i1 is already represented on 8 bits. So, the
only change would be to represent i1 and i8 on 16 bits, as all other types already fulfill this condition.</span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;"> </span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;">TargetData can help by setting a higher alignment, thus although the type is i1 or i8, the number of allocated bits is 16.
</span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;">What is the best approach to impose this?</span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;">(i) modifying the back-end of LLVM </span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;"> - where can I find the defaults for specifying the number of allocated bits for each type?</span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;">(ii) writing a pass that overwrites these defaults?</span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;"> - by asking for an alignment higher than the default</span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;"> - one approach is to set a higher alignment for each allocated variable of type i1 or i8, but this means digging inside the arrays, vectors and structures to
check the type of each element.</span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;"> </span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;">Looking forward to receiving your suggestions.</span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;"> </span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;">Thank you,</span></div>
</div>
<div>
<div class="yiv1254029591MsoNormal"><span style="font-size:10.0pt;color:black;">Alexandra</span></div>
</div>
</div>
</div>
</div>
</div><br><br> </div> </div> </div></body></html>