[llvm] [AMDGPU] Support function attribute to override postRA scheduling direction (PR #147708)
Carl Ritson via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 10 19:54:03 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()) {
----------------
perlfu wrote:
Function attributes should not override anything actually set on the command line, i.e. if command line sets an option it should override function attributes.
This mechanism as implemented is too global.
It will change direction of all PostRA schedulers.
Can you revise this change to add some way of setting a direction for specific schedulers directly?
https://github.com/llvm/llvm-project/pull/147708
More information about the llvm-commits
mailing list