<div dir="ltr"><div><div><div><div><div><div>Hi Guillaume,<br><br></div>this is an example of what we currently get in tablegen.<br><br>```<br>static const char* HaswellModelPfmIssueCounters[] = {<br>  nullptr,<br>  nullptr,<br>  nullptr,<br>  "uops_dispatched_port:port_0,",  //HWPort0<br>  "uops_dispatched_port:port_1,",  //HWPort1<br>  "uops_dispatched_port:port_2,",  //HWPort2<br>  "uops_dispatched_port:port_3,",  //HWPort3<br>  "uops_dispatched_port:port_4,",  //HWPort4<br>  "uops_dispatched_port:port_5,",  //HWPort5<br>  "uops_dispatched_port:port_6,",  //HWPort6<br>  "uops_dispatched_port:port_7,",  //HWPort7<br>  nullptr,<br>  nullptr,<br>  nullptr,<br>  nullptr,<br>  nullptr,<br>  nullptr,<br>  nullptr,<br>  nullptr,<br>  nullptr,<br>  nullptr,<br>  nullptr,<br>  nullptr,<br>};<br>```<br><br></div>You can see the comma at the end of each string.<br><br></div>Also, we found that the number of entries in that table doesn't actually match the number of processor resource unit entries. There should be 24 entries (there are 23).<br></div>When initializing that table, you weren't accounting for the extra invalid resource.<br><br></div>Simon's patch makes it easy to catch that off-by-one error (and fixes the problem with the comma).<br><br></div>P.s.: I still think that at some point we should fix PR37068 and have a single string table.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 19, 2018 at 9:03 AM, Guillaume Chatelet via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">gchatelet added a comment.<br>
<br>
FYI Clement is OOO so I'll take over the review.<br>
I'm not too familiar with TableGen: do you have a snippet of the generated code?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D45787" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D45787</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>