[llvm] [AMDGPU] Add post-RA scheduling direction control via target features (PR #147708)

Harrison Hao via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 05:22:57 PDT 2025


================
@@ -1144,6 +1144,23 @@ GCNTargetMachine::createMachineScheduler(MachineSchedContext *C) const {
 
 ScheduleDAGInstrs *
 GCNTargetMachine::createPostMachineScheduler(MachineSchedContext *C) const {
+  Attribute PostRADirectionAttr =
+      C->MF->getFunction().getFnAttribute("misched-postra-direction");
+
+  if (PostRADirectionAttr.isValid()) {
----------------
harrisonGPU wrote:

Thanks! I noticed that LLVM provides the `overridePostRASchedPolicy` hook, so I’ve switched to using a target feature to control the post-RA direction. This avoids overriding the direction for all machine schedulers and no longer conflicts with command-line overrides. What do you think about it?

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


More information about the llvm-commits mailing list