<div dir="ltr">Hi David,<div><br></div><div style>The CostTableEntry had originally two hard-coded types and only changed to a list later, I'll see if I can make it simpler.</div><div style><br></div><div style>--renato</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 16 January 2013 15:14, David Tweed <span dir="ltr"><<a href="mailto:David.Tweed@arm.com" target="_blank">David.Tweed@arm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Renato,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I'm probably missing something but couldn't you make CostTable<> be a templated base class and then have proper classes UnaryCostTable and BinaryCostTable inherit
 from it, leaving only the search method in the base. That would add a small number of lines to the code, but that way you simply wouldn't be able to call the 4 argument version of addCost un a UnaryCostTable rather than needing to check at run-time? (To my
 understanding, the compiler should generate essentially identical actual code, so I don't think there's any performance loss.)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Cheers,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Dave<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:llvm-commits-bounces@cs.uiuc.edu" target="_blank">llvm-commits-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:llvm-commits-bounces@cs.uiuc.edu" target="_blank">llvm-commits-bounces@cs.uiuc.edu</a>]
<b>On Behalf Of </b>Renato Golin Linaro<br>
<b>Sent:</b> 16 January 2013 14:50<br>
<b>To:</b> LLVM Commits; Nadav Rotem<br>
<b>Subject:</b> [llvm-commits] Cost Table Draft<u></u><u></u></span></p>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi Nadav,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I had a look at the table and tried to unify both unary and binary tables into one, leaving it simple to use and more importantly, to initialize it statically in the cost functions. The usage syntax is still very similar.<u></u><u></u></p>

</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I have used it in both cases, one and two types, to give you an example how it works. If you're ok with the code and the style, I'll apply it to all other cases (and use it on the ARM model).<u></u><u></u></p>

</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">cheers,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">--renato<u></u><u></u></p>
</div>
</div>
</div></div></div>
<br>
<font face="Arial" color="Black">-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents
 to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.<br>
</font>
</div>
</blockquote></div><br></div>