[PATCH] D45787: [llvm-exegesis] Fix PfmIssueCountersTable creation

Andrea Di Biagio via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 19 02:04:41 PDT 2018


Hi Guillaume,

this is an example of what we currently get in tablegen.

```
static const char* HaswellModelPfmIssueCounters[] = {
  nullptr,
  nullptr,
  nullptr,
  "uops_dispatched_port:port_0,",  //HWPort0
  "uops_dispatched_port:port_1,",  //HWPort1
  "uops_dispatched_port:port_2,",  //HWPort2
  "uops_dispatched_port:port_3,",  //HWPort3
  "uops_dispatched_port:port_4,",  //HWPort4
  "uops_dispatched_port:port_5,",  //HWPort5
  "uops_dispatched_port:port_6,",  //HWPort6
  "uops_dispatched_port:port_7,",  //HWPort7
  nullptr,
  nullptr,
  nullptr,
  nullptr,
  nullptr,
  nullptr,
  nullptr,
  nullptr,
  nullptr,
  nullptr,
  nullptr,
  nullptr,
};
```

You can see the comma at the end of each string.

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).
When initializing that table, you weren't accounting for the extra invalid
resource.

Simon's patch makes it easy to catch that off-by-one error (and fixes the
problem with the comma).

P.s.: I still think that at some point we should fix PR37068 and have a
single string table.

On Thu, Apr 19, 2018 at 9:03 AM, Guillaume Chatelet via Phabricator <
reviews at reviews.llvm.org> wrote:

> gchatelet added a comment.
>
> FYI Clement is OOO so I'll take over the review.
> I'm not too familiar with TableGen: do you have a snippet of the generated
> code?
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D45787
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180419/b624148f/attachment.html>


More information about the llvm-commits mailing list