[llvm] [AArch64] Disable Pre-RA Scheduler for Neoverse V2 (PR #127784)
Sjoerd Meijer via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 28 05:19:31 PDT 2025
sjoerdmeijer wrote:
I am going to abandon this because this is not going to work. I still haven't seen any evidence that instruction scheduling on itself is beneficial, but turns out it is the other things that the scheduler is also doing that is making a difference:
- [copy elimination](https://github.com/llvm/llvm-project/blob/e086d7b1464ad091ae849cb907f8647c8439cb66/llvm/lib/CodeGen/MachineScheduler.cpp#L2185C4-L2185C70)
- and possibly the [clustering](https://github.com/llvm/llvm-project/blob/e086d7b1464ad091ae849cb907f8647c8439cb66/llvm/lib/CodeGen/MachineScheduler.cpp#L1884C31-L1884C78) of loads/stores.
We found regressions disabling the scheduler, and the reason I have seen so far is because of MOV instructions that are no longer eliminated. I am not entirely sure yet about the loads/stores and if they influence performance, but it is a difference.
One idea therefore for some light weight scheduling is to separate out these optimisations from the other scheduling business.
To address the regression that we are seeing I will now pursue this direction:
- a heuristic to bail out from the machine scheduler when the function is extremely large. I forgot the exact number, but the function we look at has more than 7000 instructions, so the intuition is that for such for large functions we eat up compile-time with a very high risk of getting it wrong.
- Better would be to skip scheduling but still perform copy-elimination, but that needs some investigation how easy it is to run these things separately.
@davemgreen: let me know what you think or if you have any objections.
https://github.com/llvm/llvm-project/pull/127784
More information about the llvm-commits
mailing list