[llvm] [MISched] Add statistics to quantify scheduling (PR #138090)

Cullen Rhodes via llvm-commits llvm-commits at lists.llvm.org
Wed May 7 01:13:32 PDT 2025


c-rhodes wrote:

> A question about how this works - If you start with `A;B;C;D;E` and reorder it to `A;E;B;C;D`, does only 1 node count as in-order, or do 4? Is 4 nodes being inorder covered by #137981 (at least if they pick NodeOrder to remain in-order).

1, I fail to see how it could be 4, only A is in source order there?

As for NodeOrder it doesn't tell the full picture, a node can be picked due to some other heuristic but still be in source order. In the worst case this can mean the scheduler didnt change a thing, here's such an example:
```
llc foo.ll -mcpu=native -stats 2>&1 | grep machine-scheduler | grep pre
 157 machine-scheduler     - Number of scheduling units chosen from bottom queue pre-RA
  29 machine-scheduler     - Number of scheduling units chosen for FirstValid heuristic pre-RA
 161 machine-scheduler     - Number of instructions in source order after pre-RA scheduling
 161 machine-scheduler     - Number of instructions scheduled by pre-RA scheduler
 120 machine-scheduler     - Number of scheduling units chosen for NodeOrder heuristic pre-RA
   8 machine-scheduler     - Number of scheduling units chosen for Only1 heuristic pre-RA
   4 machine-scheduler     - Number of scheduling units chosen for PhysReg heuristic pre-RA
   4 machine-scheduler     - Number of scheduling units chosen from top queue pre-RA
```

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


More information about the llvm-commits mailing list