Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort oper allocation counts table #60223

Merged

Conversation

SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented Oct 9, 2021

Sort the table output for COUNT_AST_OPERS, improving its legibility.

Sample output of the new table when CG-ing x64 CoreLib:

GenTree operator counts (approximate):

    GT_LCL_VAR              812975 (23.1%)  72 bytes each
    GT_CNS_INT              443558 (12.6%)  72 bytes each
    GT_ASG                  300295 ( 8.5%)  64 bytes each
    GT_CALL                 197311 ( 5.6%) 144 bytes each
    GT_IL_OFFSET            185497 ( 5.3%)  48 bytes each
    GT_IND                  182090 ( 5.2%)  64 bytes each
    GT_PUTARG_REG           141099 ( 4.0%)  64 bytes each
    GT_ADDR                 137819 ( 3.9%)  64 bytes each
    GT_ARGPLACE             128510 ( 3.6%)  56 bytes each
    GT_ADD                  114240 ( 3.2%)  64 bytes each
    GT_FIELD                111934 ( 3.2%)  88 bytes each
    GT_NOP                   97413 ( 2.8%)  48 bytes each
    GT_CAST                  73225 ( 2.1%)  72 bytes each
    GT_RET_EXPR              68020 ( 1.9%)  72 bytes each
    GT_JTRUE                 63943 ( 1.8%)  64 bytes each
    GT_COMMA                 56130 ( 1.6%)  64 bytes each
    GT_PHI_ARG               51581 ( 1.5%)  72 bytes each
    GT_RETURN                38862 ( 1.1%)  64 bytes each
    GT_EQ                    36072 ( 1.0%)  64 bytes each
    GT_STOREIND              31268 ( 0.9%)  72 bytes each
    GT_NE                    29118 ( 0.8%)  64 bytes each
    GT_OBJ                   24266 ( 0.7%)  80 bytes each
    GT_PHI                   23213 ( 0.7%)  56 bytes each
    All other GT_xxx ...    175143 ( 5.0%) ...  4.7% small +  0.3% large
    -----------------------------------------------------
    Total    .......       3523582 --ALL-- ... 91.0% small +  9.0% large

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Oct 9, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 9, 2021
@ghost
Copy link

ghost commented Oct 9, 2021

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

There are two commits in this change:

  1. Sort the table output by COUNT_AST_OPERS - straightforward change improving its legibility.
  2. Format the existing table for NODEBASH_STATS:
  3. Group by the new oper.
  4. Add relative counts.
  5. Only print 'X' where the "actual" size of the node grew (it is not very useful to pay attention to cases where a small node was bashed to a slightly larger small node, we're mostly interested in cases where we see things bashed to calls).

Add a new table, activated when COUNT_AST_OPERS is defined:

  1. Group by the old oper.
  2. Add relative counts of how many opers were bashed.

The first table is useful for investigating some particular cases of ChangeOper / SetOper calls, the second - for getting an overview of how efficient/reasonable the node sizes are.

Note that the second table can contain inaccuracies pertaining to > 100 % values in the "Created and bashed" column, those are
cases where a node was bashed more than twice, which is common for some opers (e. g. OBJ -> STORE_OBJ -> IND). I've left the "nonsensical" infs in for now because it does not seem to me that there is a great way to represent them (it means no node was created with such an oper in the first place).

Sample output of the new tables when CG-ing x64 CoreLib:

Bashed gtOper stats:

   Old operator        New operator     #bytes old->new      Counts Percentages
 ==================================================================================
 | GT_ASG              GT_STORE_LCL_VAR [size:  64-> 72]     164029 24.89% 24.89% |
 |--------------------------------------------------------------------------------|
 | GT_FIELD            GT_IND           [size:  88-> 64]      67744 10.28% 14.06% |
 | GT_OBJ                               [size:  80-> 64]      10880  1.65%        |
 | GT_ARR_LENGTH                        [size:  64-> 64]       7131  1.08%        |
 | GT_INDEX                             [size:  80-> 64]       5171  0.78%        |
 | GT_BLK                               [size:  80-> 64]       1724  0.26%        |
 | GT_HWINTRINSIC                       [size:  80-> 64]         21  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_ADD              GT_LEA           [size:  64-> 80]      80352 12.19% 12.19% |
 |--------------------------------------------------------------------------------|
 | GT_FIELD            GT_LCL_VAR       [size:  88-> 72]      36950  5.61%  9.81% |
 | GT_CALL                              [size: 144-> 72]      12146  1.84%        |
 | GT_RET_EXPR                          [size:  72-> 72]      10652  1.62%        |
 | GT_ADDR                              [size:  64-> 72]       4330  0.66%        |
 | GT_OBJ                               [size:  80-> 72]        567  0.09%        |
 | GT_BLK                               [size:  80-> 72]         12  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_CAST             GT_CNS_INT       [size:  72-> 72]      28496  4.32%  7.91% |
 | GT_EQ                                [size:  64-> 72]      10558  1.60%        |
 | GT_NE                                [size:  64-> 72]       5395  0.82%        |
 | GT_MUL                               [size:  64-> 72]       3256  0.49%        |
 | GT_CALL                              [size: 144-> 72]       2556  0.39%        |
 | GT_GE                                [size:  64-> 72]        679  0.10%        |
 | GT_DIV                               [size:  64-> 72]        478  0.07%        |
 | GT_LE                                [size:  64-> 72]        212  0.03%        |
 | GT_LSH                               [size:  64-> 72]        174  0.03%        |
 | GT_GT                                [size:  64-> 72]        155  0.02%        |
 | GT_NOT                               [size:  64-> 72]        138  0.02%        |
 | GT_RSH                               [size:  64-> 72]         14  0.00%        |
 | GT_NEG                               [size:  64-> 72]         13  0.00%        |
 | GT_BSWAP                             [size:  64-> 72]          4  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_RET_EXPR         GT_CALL          [size:  72->144]      15998  2.43%  4.27% |
 | GT_ALLOCOBJ                          [size:  88->144]       7785  1.18%        |
 | GT_CALL                              [size: 144->144]       4317  0.66%        |
 | GT_MOD                               [size:  64->144] X       33  0.01%        |
 | GT_CAST                              [size:  72->144]         13  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_CALL             GT_FIELD         [size: 144-> 88]      15138  2.30%  4.02% |
 | GT_RET_EXPR                          [size:  72-> 88]      11272  1.71%        |
 | GT_LCL_VAR                           [size:  72-> 88] X       69  0.01%        |
 |--------------------------------------------------------------------------------|
 | GT_SUB              GT_ADD           [size:  64-> 64]       7105  1.08%  2.58% |
 | GT_LCL_VAR                           [size:  72-> 64]       6356  0.96%        |
 | GT_CALL                              [size: 144-> 64]       3381  0.51%        |
 | GT_DIV                               [size:  64-> 64]        171  0.03%        |
 |--------------------------------------------------------------------------------|
 | GT_ASG              GT_NOP           [size:  64-> 48]      14137  2.15%  2.57% |
 | GT_JTRUE                             [size:  64-> 48]       2095  0.32%        |
 | GT_STORE_LCL_VAR                     [size:  72-> 48]        609  0.09%        |
 | GT_CAST                              [size:  72-> 48]         78  0.01%        |
 |--------------------------------------------------------------------------------|
 | GT_ADDR             GT_LCL_VAR_ADDR  [size:  64-> 72]       9015  1.37%  2.32% |
 | GT_LCL_VAR                           [size:  72-> 72]       6279  0.95%        |
 |--------------------------------------------------------------------------------|
 | GT_NE               GT_EQ            [size:  64-> 64]       7476  1.13%  1.63% |
 | GT_CALL                              [size: 144-> 64]       2317  0.35%        |
 | GT_EQ                                [size:  64-> 64]        909  0.14%        |
 | GT_LE                                [size:  64-> 64]         39  0.01%        |
 | GT_GE                                [size:  64-> 64]         22  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_MUL              GT_LSH           [size:  64-> 64]       8758  1.33%  1.38% |
 | GT_ADD                               [size:  64-> 64]        328  0.05%        |
 | GT_RET_EXPR                          [size:  72-> 64]          3  0.00%        |
 | GT_CALL                              [size: 144-> 64]          3  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_LE               GT_GT            [size:  64-> 64]       8712  1.32%  1.35% |
 | GT_GE                                [size:  64-> 64]        120  0.02%        |
 | GT_CALL                              [size: 144-> 64]         43  0.01%        |
 |--------------------------------------------------------------------------------|
 | GT_ASG              GT_STORE_LCL_FLD [size:  64-> 80]       8611  1.31%  1.31% |
 |--------------------------------------------------------------------------------|
 | GT_CALL             GT_CAST          [size: 144-> 72]       4632  0.70%  1.29% |
 | GT_RET_EXPR                          [size:  72-> 72]       2825  0.43%        |
 | GT_LCL_VAR                           [size:  72-> 72] X     1076  0.16%        |
 |--------------------------------------------------------------------------------|
 | GT_OBJ              GT_BLK           [size:  80-> 80]       8170  1.24%  1.24% |
 |--------------------------------------------------------------------------------|
 | GT_GT               GT_LE            [size:  64-> 64]       3749  0.57%  1.04% |
 | GT_GE                                [size:  64-> 64]       2862  0.43%        |
 | GT_LT                                [size:  64-> 64]        255  0.04%        |
 |--------------------------------------------------------------------------------|
 | GT_FIELD            GT_LCL_FLD       [size:  88-> 80]       5274  0.80%  0.81% |
 | GT_IND                               [size:  64-> 80]         80  0.01%        |
 |--------------------------------------------------------------------------------|
 | GT_CALL             GT_RET_EXPR      [size: 144-> 72]       4944  0.75%  0.75% |
 |--------------------------------------------------------------------------------|
 | GT_CALL             GT_ASG           [size: 144-> 64]       3499  0.53%  0.53% |
 |--------------------------------------------------------------------------------|
 | GT_CALL             GT_ADDR          [size: 144-> 64]       3431  0.52%  0.52% |
 |--------------------------------------------------------------------------------|
 | GT_STORE_OBJ        GT_STORE_BLK     [size:  80-> 80]       2083  0.32%  0.50% |
 | GT_BLK                               [size:  80-> 80]       1197  0.18%        |
 |--------------------------------------------------------------------------------|
 | GT_STORE_LCL_VAR    GT_STORE_OBJ     [size:  72-> 80]       2076  0.32%  0.47% |
 | GT_OBJ                               [size:  80-> 80]       1016  0.15%        |
 |--------------------------------------------------------------------------------|
 | GT_NE               GT_NE            [size:  64-> 64]       1049  0.16%  0.45% |
 | GT_CALL                              [size: 144-> 64]        852  0.13%        |
 | GT_RET_EXPR                          [size:  72-> 64]        850  0.13%        |
 | GT_GE                                [size:  64-> 64]        210  0.03%        |
 | GT_LE                                [size:  64-> 64]         36  0.01%        |
 |--------------------------------------------------------------------------------|
 | GT_LT               GT_GE            [size:  64-> 64]       2187  0.33%  0.38% |
 | GT_LE                                [size:  64-> 64]        288  0.04%        |
 |--------------------------------------------------------------------------------|
 | GT_GT               GT_LT            [size:  64-> 64]        997  0.15%  0.23% |
 | GT_CALL                              [size: 144-> 64]        498  0.08%        |
 |--------------------------------------------------------------------------------|
 | GT_CALL             GT_AND           [size: 144-> 64]        660  0.10%  0.20% |
 | GT_RET_EXPR                          [size:  72-> 64]        630  0.10%        |
 | GT_MOD                               [size:  64-> 64]         18  0.00%        |
 | GT_UMOD                              [size:  64-> 64]          9  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_EQ               GT_TEST_EQ       [size:  64-> 64]       1278  0.19%  0.19% |
 |--------------------------------------------------------------------------------|
 | GT_NE               GT_TEST_NE       [size:  64-> 64]       1256  0.19%  0.19% |
 |--------------------------------------------------------------------------------|
 | GT_LCL_FLD          GT_LCL_FLD_ADDR  [size:  80-> 80]        718  0.11%  0.17% |
 | GT_ADDR                              [size:  64-> 80]        426  0.06%        |
 |--------------------------------------------------------------------------------|
 | GT_STORE_BLK        GT_STOREIND      [size:  80-> 72]        858  0.13%  0.16% |
 | GT_STORE_OBJ                         [size:  80-> 72]        212  0.03%        |
 |--------------------------------------------------------------------------------|
 | GT_RET_EXPR         GT_SUB           [size:  72-> 64]        406  0.06%  0.10% |
 | GT_CALL                              [size: 144-> 64]        258  0.04%        |
 | GT_ADD                               [size:  64-> 64]          2  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_JTRUE            GT_JCC           [size:  64-> 56]        450  0.07%  0.07% |
 |--------------------------------------------------------------------------------|
 | GT_UDIV             GT_RSZ           [size:  64-> 64]        401  0.06%  0.06% |
 | GT_RET_EXPR                          [size:  72-> 64]         13  0.00%        |
 | GT_LCL_VAR                           [size:  72-> 64]          2  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_DYN_BLK          GT_STORE_DYN_BLK [size:  96-> 96]        389  0.06%  0.06% |
 |--------------------------------------------------------------------------------|
 | GT_OR               GT_ROL           [size:  64-> 64]        297  0.05%  0.05% |
 |--------------------------------------------------------------------------------|
 | GT_RET_EXPR         GT_DIV           [size:  72-> 64]        154  0.02%  0.04% |
 | GT_MOD                               [size:  64-> 64]        132  0.02%        |
 | GT_LCL_VAR                           [size:  72-> 64]          9  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_UDIV             GT_BITCAST       [size:  64-> 64]        168  0.03%  0.03% |
 |--------------------------------------------------------------------------------|
 | GT_RET_EXPR         GT_UDIV          [size:  72-> 64]         76  0.01%  0.02% |
 | GT_CALL                              [size: 144-> 64]         76  0.01%        |
 |--------------------------------------------------------------------------------|
 | GT_LCL_VAR          GT_OR            [size:  72-> 64]        149  0.02%  0.02% |
 |--------------------------------------------------------------------------------|
 | GT_RET_EXPR         GT_XOR           [size:  72-> 64]        111  0.02%  0.02% |
 | GT_LCL_VAR                           [size:  72-> 64]         28  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_RET_EXPR         GT_INTRINSIC     [size:  72-> 96]        114  0.02%  0.02% |
 |--------------------------------------------------------------------------------|
 | GT_FIELD            GT_NULLCHECK     [size:  88-> 64]         70  0.01%  0.01% |
 | GT_OBJ                               [size:  80-> 64]         26  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_CALL             GT_INDEX         [size: 144-> 80]         93  0.01%  0.01% |
 |--------------------------------------------------------------------------------|
 | GT_RET_EXPR         GT_OBJ           [size:  72-> 80]         83  0.01%  0.01% |
 |--------------------------------------------------------------------------------|
 | GT_CAST             GT_CNS_DBL       [size:  72-> 56]         52  0.01%  0.01% |
 | GT_MUL                               [size:  64-> 56]         28  0.00%        |
 | GT_DIV                               [size:  64-> 56]          1  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_RET_EXPR         GT_CNS_STR       [size:  72-> 64]         37  0.01%  0.01% |
 | GT_CALL                              [size: 144-> 64]         37  0.01%        |
 |--------------------------------------------------------------------------------|
 | GT_XADD             GT_LOCKADD       [size:  64-> 64]         23  0.00%  0.00% |
 |--------------------------------------------------------------------------------|
 | GT_RET_EXPR         GT_CMPXCHG       [size:  72-> 72]         17  0.00%  0.00% |
 |--------------------------------------------------------------------------------|
 | GT_RET_EXPR         GT_COMMA         [size:  72-> 64]         14  0.00%  0.00% |
 |--------------------------------------------------------------------------------|
 | GT_NE               GT_SETCC         [size:  64-> 56]         13  0.00%  0.00% |
 |--------------------------------------------------------------------------------|
 | GT_LCL_VAR          GT_NEG           [size:  72-> 64]          1  0.00%  0.00% |
 | GT_RET_EXPR                          [size:  72-> 64]          1  0.00%        |
 |--------------------------------------------------------------------------------|
 | GT_CALL             GT_XCHG          [size: 144-> 64]          2  0.00%  0.00% |
 |--------------------------------------------------------------------------------|
 | GT_LCL_VAR          GT_NOT           [size:  72-> 64]          1  0.00%  0.00% |
 ==================================================================================

Total bashings: 658964


Bashed opers stats, relative to original opers:

   Old operator     New operator         Bashed  Created and bashed
 ===================================================================
 | GT_ASG           GT_STORE_LCL_VAR     164029  54.62%     62.20% |
 |                  GT_NOP                14137   4.71%            |
 |                  GT_STORE_LCL_FLD       8611   2.87%            |
 |-----------------------------------------------------------------|
 | GT_FIELD         GT_IND                67744  60.52%     98.31% |
 |                  GT_LCL_VAR            36950  33.01%            |
 |                  GT_LCL_FLD             5274   4.71%            |
 |                  GT_NULLCHECK             70   0.06%            |
 |-----------------------------------------------------------------|
 | GT_ADD           GT_LEA                80352  70.34%     70.62% |
 |                  GT_LSH                  328   0.29%            |
 |                  GT_SUB                    2   0.00%            |
 |-----------------------------------------------------------------|
 | GT_CALL          GT_FIELD              15138   7.67%     29.84% |
 |                  GT_LCL_VAR            12146   6.16%            |
 |                  GT_RET_EXPR            4944   2.51%            |
 |                  GT_CAST                4632   2.35%            |
 |                  GT_CALL                4317   2.19%            |
 |                  GT_ASG                 3499   1.77%            |
 |                  GT_ADDR                3431   1.74%            |
 |                  GT_ADD                 3381   1.71%            |
 |                  GT_CNS_INT             2556   1.30%            |
 |                  GT_EQ                  2317   1.17%            |
 |                  GT_NE                   852   0.43%            |
 |                  GT_AND                  660   0.33%            |
 |                  GT_LT                   498   0.25%            |
 |                  GT_SUB                  258   0.13%            |
 |                  GT_INDEX                 93   0.05%            |
 |                  GT_UDIV                  76   0.04%            |
 |                  GT_GT                    43   0.02%            |
 |                  GT_CNS_STR               37   0.02%            |
 |                  GT_LSH                    3   0.00%            |
 |                  GT_XCHG                   2   0.00%            |
 |-----------------------------------------------------------------|
 | GT_RET_EXPR      GT_CALL               15998  23.52%     63.59% |
 |                  GT_FIELD              11272  16.57%            |
 |                  GT_LCL_VAR            10652  15.66%            |
 |                  GT_CAST                2825   4.15%            |
 |                  GT_NE                   850   1.25%            |
 |                  GT_AND                  630   0.93%            |
 |                  GT_SUB                  406   0.60%            |
 |                  GT_DIV                  154   0.23%            |
 |                  GT_INTRINSIC            114   0.17%            |
 |                  GT_XOR                  111   0.16%            |
 |                  GT_OBJ                   83   0.12%            |
 |                  GT_UDIV                  76   0.11%            |
 |                  GT_CNS_STR               37   0.05%            |
 |                  GT_CMPXCHG               17   0.02%            |
 |                  GT_COMMA                 14   0.02%            |
 |                  GT_RSZ                   13   0.02%            |
 |                  GT_LSH                    3   0.00%            |
 |                  GT_NEG                    1   0.00%            |
 |-----------------------------------------------------------------|
 | GT_CAST          GT_CNS_INT            28496  38.92%     39.11% |
 |                  GT_NOP                   78   0.11%            |
 |                  GT_CNS_DBL               52   0.07%            |
 |                  GT_CALL                  13   0.02%            |
 |-----------------------------------------------------------------|
 | GT_OBJ           GT_IND                10880  44.84%     85.14% |
 |                  GT_BLK                 8170  33.67%            |
 |                  GT_STORE_OBJ           1016   4.19%            |
 |                  GT_LCL_VAR              567   2.34%            |
 |                  GT_NULLCHECK             26   0.11%            |
 |-----------------------------------------------------------------|
 | GT_NE            GT_EQ                  7476  25.67%     52.16% |
 |                  GT_CNS_INT             5395  18.53%            |
 |                  GT_TEST_NE             1256   4.31%            |
 |                  GT_NE                  1049   3.60%            |
 |                  GT_SETCC                 13   0.04%            |
 |-----------------------------------------------------------------|
 | GT_LCL_VAR       GT_ADD                 6356   0.78%      1.72% |
 |                  GT_LCL_VAR_ADDR        6279   0.77%            |
 |                  GT_CAST                1076   0.13%            |
 |                  GT_OR                   149   0.02%            |
 |                  GT_FIELD                 69   0.01%            |
 |                  GT_XOR                   28   0.00%            |
 |                  GT_DIV                    9   0.00%            |
 |                  GT_RSZ                    2   0.00%            |
 |                  GT_NOT                    1   0.00%            |
 |                  GT_NEG                    1   0.00%            |
 |-----------------------------------------------------------------|
 | GT_ADDR          GT_LCL_VAR_ADDR        9015   6.54%      9.99% |
 |                  GT_LCL_VAR             4330   3.14%            |
 |                  GT_LCL_FLD_ADDR         426   0.31%            |
 |-----------------------------------------------------------------|
 | GT_EQ            GT_CNS_INT            10558  29.27%     35.33% |
 |                  GT_TEST_EQ             1278   3.54%            |
 |                  GT_EQ                   909   2.52%            |
 |-----------------------------------------------------------------|
 | GT_MUL           GT_LSH                 8758  52.59%     72.32% |
 |                  GT_CNS_INT             3256  19.55%            |
 |                  GT_CNS_DBL               28   0.17%            |
 |-----------------------------------------------------------------|
 | GT_LE            GT_GT                  8712 172.04%    183.39% |
 |                  GT_GE                   288   5.69%            |
 |                  GT_CNS_INT              212   4.19%            |
 |                  GT_EQ                    39   0.77%            |
 |                  GT_NE                    36   0.71%            |
 |-----------------------------------------------------------------|
 | GT_ALLOCOBJ      GT_CALL                7785  95.93%     95.93% |
 |-----------------------------------------------------------------|
 | GT_ARR_LENGTH    GT_IND                 7131  55.83%     55.83% |
 |-----------------------------------------------------------------|
 | GT_SUB           GT_ADD                 7105  81.07%     81.07% |
 |-----------------------------------------------------------------|
 | GT_INDEX         GT_IND                 5171  98.29%     98.29% |
 |-----------------------------------------------------------------|
 | GT_GT            GT_LE                  3749  89.33%    116.77% |
 |                  GT_LT                   997  23.76%            |
 |                  GT_CNS_INT              155   3.69%            |
 |-----------------------------------------------------------------|
 | GT_GE            GT_LE                  2862  50.84%     69.16% |
 |                  GT_CNS_INT              679  12.06%            |
 |                  GT_NE                   210   3.73%            |
 |                  GT_GT                   120   2.13%            |
 |                  GT_EQ                    22   0.39%            |
 |-----------------------------------------------------------------|
 | GT_BLK           GT_IND                 1724  83.16%    141.49% |
 |                  GT_STORE_BLK           1197  57.74%            |
 |                  GT_LCL_VAR               12   0.58%            |
 |-----------------------------------------------------------------|
 | GT_STORE_LCL_VAR GT_STORE_OBJ           2076    inf%       inf% |
 |                  GT_NOP                  609    inf%            |
 |-----------------------------------------------------------------|
 | GT_JTRUE         GT_NOP                 2095   3.28%      3.98% |
 |                  GT_JCC                  450   0.70%            |
 |-----------------------------------------------------------------|
 | GT_LT            GT_GE                  2187  36.58%     40.85% |
 |                  GT_LE                   255   4.27%            |
 |-----------------------------------------------------------------|
 | GT_STORE_OBJ     GT_STORE_BLK           2083    inf%       inf% |
 |                  GT_STOREIND             212    inf%            |
 |-----------------------------------------------------------------|
 | GT_STORE_BLK     GT_STOREIND             858    inf%       inf% |
 |-----------------------------------------------------------------|
 | GT_LCL_FLD       GT_LCL_FLD_ADDR         718  11.05%     11.05% |
 |-----------------------------------------------------------------|
 | GT_DIV           GT_CNS_INT              478  56.70%     77.11% |
 |                  GT_ADD                  171  20.28%            |
 |                  GT_CNS_DBL                1   0.12%            |
 |-----------------------------------------------------------------|
 | GT_UDIV          GT_RSZ                  401  59.85%     84.93% |
 |                  GT_BITCAST              168  25.07%            |
 |-----------------------------------------------------------------|
 | GT_DYN_BLK       GT_STORE_DYN_BLK        389 505.19%    505.19% |
 |-----------------------------------------------------------------|
 | GT_OR            GT_ROL                  297  16.12%     16.12% |
 |-----------------------------------------------------------------|
 | GT_MOD           GT_DIV                  132  72.13%    100.00% |
 |                  GT_CALL                  33  18.03%            |
 |                  GT_AND                   18   9.84%            |
 |-----------------------------------------------------------------|
 | GT_LSH           GT_CNS_INT              174   9.85%      9.85% |
 |-----------------------------------------------------------------|
 | GT_NOT           GT_CNS_INT              138  70.05%     70.05% |
 |-----------------------------------------------------------------|
 | GT_IND           GT_LCL_FLD               80   0.04%      0.04% |
 |-----------------------------------------------------------------|
 | GT_XADD          GT_LOCKADD               23  20.91%     20.91% |
 |-----------------------------------------------------------------|
 | GT_HWINTRINSIC   GT_IND                   21   0.84%      0.84% |
 |-----------------------------------------------------------------|
 | GT_RSH           GT_CNS_INT               14   1.45%      1.45% |
 |-----------------------------------------------------------------|
 | GT_NEG           GT_CNS_INT               13   2.53%      2.53% |
 |-----------------------------------------------------------------|
 | GT_UMOD          GT_AND                    9   6.29%      6.29% |
 |-----------------------------------------------------------------|
 | GT_BSWAP         GT_CNS_INT                4  10.26%     10.26% |
 ===================================================================

Total bashings: 18.70% (658964) of all (3523582) opers were bashed


GenTree operator counts (approximate):

    GT_LCL_VAR              812975 (23.1%)  72 bytes each
    GT_CNS_INT              443558 (12.6%)  72 bytes each
    GT_ASG                  300295 ( 8.5%)  64 bytes each
    GT_CALL                 197311 ( 5.6%) 144 bytes each
    GT_IL_OFFSET            185497 ( 5.3%)  48 bytes each
    GT_IND                  182090 ( 5.2%)  64 bytes each
    GT_PUTARG_REG           141099 ( 4.0%)  64 bytes each
    GT_ADDR                 137819 ( 3.9%)  64 bytes each
    GT_ARGPLACE             128510 ( 3.6%)  56 bytes each
    GT_ADD                  114240 ( 3.2%)  64 bytes each
    GT_FIELD                111934 ( 3.2%)  88 bytes each
    GT_NOP                   97413 ( 2.8%)  48 bytes each
    GT_CAST                  73225 ( 2.1%)  72 bytes each
    GT_RET_EXPR              68020 ( 1.9%)  72 bytes each
    GT_JTRUE                 63943 ( 1.8%)  64 bytes each
    GT_COMMA                 56130 ( 1.6%)  64 bytes each
    GT_PHI_ARG               51581 ( 1.5%)  72 bytes each
    GT_RETURN                38862 ( 1.1%)  64 bytes each
    GT_EQ                    36072 ( 1.0%)  64 bytes each
    GT_STOREIND              31268 ( 0.9%)  72 bytes each
    GT_NE                    29118 ( 0.8%)  64 bytes each
    GT_OBJ                   24266 ( 0.7%)  80 bytes each
    GT_PHI                   23213 ( 0.7%)  56 bytes each
    All other GT_xxx ...    175143 ( 5.0%) ...  4.7% small +  0.3% large
    -----------------------------------------------------
    Total    .......       3523582 --ALL-- ... 91.0% small +  9.0% large
Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr, community-contribution

Milestone: -

@SingleAccretion
Copy link
Contributor Author

SingleAccretion commented Oct 10, 2021

Edit: I decided to leave NODEBASH_STATS out of this PR completely, I did not like where I ended up with it.

@SingleAccretion SingleAccretion force-pushed the Improving-Node-Stats-Reporting branch from 4fd5556 to cc6371b Compare October 10, 2021 15:55
@SingleAccretion SingleAccretion changed the title Improve node stats reporting Sort oper allocation counts table Oct 10, 2021
And some refactoring while I was there.
@SingleAccretion SingleAccretion force-pushed the Improving-Node-Stats-Reporting branch from cc6371b to fe7a2ea Compare October 15, 2021 15:55
@SingleAccretion SingleAccretion marked this pull request as ready for review October 15, 2021 17:41
@SingleAccretion
Copy link
Contributor Author

SingleAccretion commented Oct 15, 2021

@dotnet/jit-contrib simple change making the output of one of our many dumping #defines a little bit nicer.

@BruceForstall BruceForstall self-requested a review October 18, 2021 23:29
Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@BruceForstall BruceForstall merged commit 14089cf into dotnet:main Oct 18, 2021
@SingleAccretion SingleAccretion deleted the Improving-Node-Stats-Reporting branch October 19, 2021 09:58
@ghost ghost locked as resolved and limited conversation to collaborators Nov 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants