[PATCH] D115138: [llvm-mca] Compare multiple files

Andrea Di Biagio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 06:20:33 PST 2021


andreadb added a comment.

In D115138#3182603 <https://reviews.llvm.org/D115138#3182603>, @mmatic05 wrote:

> - addressed comments
>
> Thanks a lot everyone on suggestions and comments. 
> We do not have information about the resource pressure (for iteration) in the json object that is the result of the llvm-mca tool. This may be one of the future patches, which will parse the stdout. I would also leave the json format printing for some next patch.

That's not correct.

Information about the per-"iteration resource pressure" is already in the json output.

Example:

  addq    %rax, %rcx
  addq    %rax, %rdx
  addq    %rax, %rsi
  addq    %rax, %rdi

Assuming the following simulation parameters:

  "SimulationParameters": {
    "-march": "x86_64",
    "-mcpu": "znver1",
    "-mtriple": "x86_64-unknown-linux-gnu"
  },

For 10 iterations, you get the following json output for the resource pressure view:

  "Instructions": [
    "addq\t%rax, %rcx",
    "addq\t%rax, %rdx",
    "addq\t%rax, %rsi",
    "addq\t%rax, %rdi"
  ],
  "ResourcePressureView": {
    "ResourcePressureInfo": [
      {
        "InstructionIndex": 0,
        "ResourceIndex": 5,
        "ResourceUsage": 1
      },
      {
        "InstructionIndex": 1,
        "ResourceIndex": 4,
        "ResourceUsage": 1
      },
      {
        "InstructionIndex": 2,
        "ResourceIndex": 3,
        "ResourceUsage": 1
      },
      {
        "InstructionIndex": 3,
        "ResourceIndex": 2,
        "ResourceUsage": 1
      },
      {
        "InstructionIndex": 4,
        "ResourceIndex": 2,
        "ResourceUsage": 1
      },
      {
        "InstructionIndex": 4,
        "ResourceIndex": 3,
        "ResourceUsage": 1
      },
      {
        "InstructionIndex": 4,
        "ResourceIndex": 4,
        "ResourceUsage": 1
      },
      {
        "InstructionIndex": 4,
        "ResourceIndex": 5,
        "ResourceUsage": 1
      }
    ]
  },

There are four instructions and five indices. The last index is always for the full iteration. The index value for the iteration matches the length (in number of instructions) of the code snippet in input. So, it is 4 for that example.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115138/new/

https://reviews.llvm.org/D115138



More information about the llvm-commits mailing list