[llvm] [MCA] New option to report scheduling information: -scheduling-info (PR #126703)

Cullen Rhodes via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 07:59:40 PST 2025


https://github.com/c-rhodes commented:

thanks for the patch. IIUC, this adds a new `-scheduling-info` option, which is similar to `-instruction-info`. So whereas `-instruction-info` has:
```
Instruction Info:
[1]: #uOps
[2]: Latency
[3]: RThroughput
[4]: MayLoad
[5]: MayStore
[6]: HasSideEffects (U)
```

this option has:
```
Scheduling Info:
[1]: #uOps
[2]: Latency
[3]: Bypass Latency
[4]: Throughput
[5]: Resources
[6]: LLVM OpcodeName
[7]: Instruction
[8]: Comment if any
```

and the purpose of this new option is to make it easier to compare the model against a good reference (and fix if necessary), which is specified via a comment after the assembly instruction.

So for example:

```
echo "abs D15, D11  /* ABS <V><d>, <V><n>  \\ ASIMD arith, basic  \\ 1 2  2  4.0 V1UnitV */" | build/bin/llvm-mca -mtriple=aarch64 -mcpu=neoverse-v1 -scheduling-info
...
Scheduling Info:
[1]: #uOps
[2]: Latency
[3]: Bypass Latency
[4]: Throughput
[5]: Resources
[6]: LLVM OpcodeName
[7]: Instruction
[8]: Comment if any
 [1]    [2]  [3]   [4]      [5]                                                                [6]                [7]                                 [8]
  1    | 2  | 2   | 4.00   | V1UnitV                                                          | ABSv1i64         | abs  d15, d11                       /* ABS <V><d>, <V><n>  \ ASIMD arith, basic  \ 1 2  2  4.0 V1UnitV */
```

here we can compare `1    | 2  | 2   | 4.00   | V1UnitV` against the reference in the comment and see it's ok.

There's a few things going on here. I can see value in some of the extra info alongside the instruction like bypass latency/resources/LLVM OpcodeName, but this could be added to the existing `-instruction-info` view if there's agreement this is useful?

For the reference, why not just make the CHECK lines in a test like `llvm/test/tools/llvm-mca/AArch64/Neoverse/V1-basic-instructions.s` be the reference? It would have to be XFAIL'ed until the model matched the reference, but any difference would be obvious looking at the diff after running the update script.

https://github.com/llvm/llvm-project/pull/126703


More information about the llvm-commits mailing list