[llvm] [RISCV] add load/store misched/PostRA cluster options (PR #149409)

Daniel Henrique Barboza via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 18 08:25:14 PDT 2025


================
@@ -301,10 +321,13 @@ ScheduleDAGInstrs *
 RISCVTargetMachine::createMachineScheduler(MachineSchedContext *C) const {
   ScheduleDAGMILive *DAG = createSchedLive(C);
   if (EnableMISchedLoadStoreClustering) {
----------------
danielhb wrote:

All added options are defaulted to 'true', similar to the 2 existing options.  But the older options have precedence. In the commit msg I gave an example:

"To preserve the existing behavior of the existing flags all options added
are default 'true'. Note that the two existing flags have precedence, so
setting "riscv-misched-load-store-clustering=false" will disable load
mutations even if setting riscv-misched-load-clustering=true. Same thing
with stores and with the postRA options."

So riscv-misched-load-store-clustering=false will turn off misched clustering for both loads and stores, regardless of riscv-misched-(load/store)-clustering being set to 'true' in the same command line. 

Perhaps a better wording would be "disabling takes precedence" because that's how the code works, e.g.:

- riscv-misched-load-store-clustering=false  will always disable both load and store clustering for misched;
- riscv-misched-load-clustering=false will always disable load clustering for misched;
- riscv-misched-store-clustering=false will always disable store clustering for misched.


I thought about inverting the semantics of the flag, i.e. adding options that would disable steps instead of enabling, but that didn't make the situation much better. What would make it better is to remove the existing 2 options, but then we'll have to deal with potential broken scripts.

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


More information about the llvm-commits mailing list