[llvm] [MISched] Extend overridePostRASchedPolicy to support per-function scheduling direction (PR #149297)

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 21 01:25:19 PDT 2025


wangpc-pp wrote:

> though I'm not sure how many people is using it (downstream), but I don't think `NumRegionInstrs` can be easily calculated from MachineFunction. Plus, fundamentally this API is called per region rather than per function, so I'm wondering instead of passing in only the MachineFunction, could we pass in [`SchedRegion`](https://github.com/llvm/llvm-project/blob/661cbd5a5254de22ba87a49e89f54b30e2874fb3/llvm/lib/CodeGen/MachineScheduler.cpp#L776) instead, which has both the MachineInstr iterators and number of instructions in the region (you have to make `SchedRegion` public, of course)

I would prefer to pass `SchedRegion` here. @harrisonGPU 

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


More information about the llvm-commits mailing list