TaoPan created this revision. Herald added subscribers: ecnelises, hiraditya. TaoPan requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits.
Scheduler can be registered through static RegisterScheduler if the host cpp file is linked, the schedulers of SchedulerDAGRRList.cpp and SchedulerDAGVLIW.cpp are visible as functions createXxx of these two cpp files are called by SelectionDAGISel.cpp, add calling to createXxx of ScheduleDAGFast.cpp to make scheduler fast and linearize visible. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D101601 Files: clang/test/CodeGen/pre-ra-sched.c llvm/include/llvm/CodeGen/TargetLowering.h llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -270,6 +270,10 @@ return createHybridListDAGScheduler(IS, OptLevel); if (TLI->getSchedulingPreference() == Sched::VLIW) return createVLIWDAGScheduler(IS, OptLevel); + if (TLI->getSchedulingPreference() == Sched::Fast) + return createFastDAGScheduler(IS, OptLevel); + if (TLI->getSchedulingPreference() == Sched::Linearize) + return createDAGLinearizer(IS, OptLevel); assert(TLI->getSchedulingPreference() == Sched::ILP && "Unknown sched type!"); return createILPListDAGScheduler(IS, OptLevel); Index: llvm/include/llvm/CodeGen/TargetLowering.h =================================================================== --- llvm/include/llvm/CodeGen/TargetLowering.h +++ llvm/include/llvm/CodeGen/TargetLowering.h @@ -94,14 +94,16 @@ namespace Sched { - enum Preference { - None, // No preference - Source, // Follow source order. - RegPressure, // Scheduling for lowest register pressure. - Hybrid, // Scheduling for both latency and register pressure. - ILP, // Scheduling for ILP in low register pressure mode. - VLIW // Scheduling for VLIW targets. - }; +enum Preference { + None, // No preference + Source, // Follow source order. + RegPressure, // Scheduling for lowest register pressure. + Hybrid, // Scheduling for both latency and register pressure. + ILP, // Scheduling for ILP in low register pressure mode. + VLIW, // Scheduling for VLIW targets. + Fast, // Fast suboptimal list scheduling + Linearize, // Linearize DAG, no scheduling +}; } // end namespace Sched Index: clang/test/CodeGen/pre-ra-sched.c =================================================================== --- /dev/null +++ clang/test/CodeGen/pre-ra-sched.c @@ -0,0 +1,8 @@ +// RUN: %clang %s -mllvm -pre-RA-sched=fast -c -o - | FileCheck %s +// RUN: %clang %s -mllvm -pre-RA-sched=linearize -c -o - | FileCheck %s + +// CHECK-NOT: clang (LLVM option parsing): for the --pre-RA-sched option: Cannot find option named + +int main() { + return 0; +}
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -270,6 +270,10 @@ return createHybridListDAGScheduler(IS, OptLevel); if (TLI->getSchedulingPreference() == Sched::VLIW) return createVLIWDAGScheduler(IS, OptLevel); + if (TLI->getSchedulingPreference() == Sched::Fast) + return createFastDAGScheduler(IS, OptLevel); + if (TLI->getSchedulingPreference() == Sched::Linearize) + return createDAGLinearizer(IS, OptLevel); assert(TLI->getSchedulingPreference() == Sched::ILP && "Unknown sched type!"); return createILPListDAGScheduler(IS, OptLevel); Index: llvm/include/llvm/CodeGen/TargetLowering.h =================================================================== --- llvm/include/llvm/CodeGen/TargetLowering.h +++ llvm/include/llvm/CodeGen/TargetLowering.h @@ -94,14 +94,16 @@ namespace Sched { - enum Preference { - None, // No preference - Source, // Follow source order. - RegPressure, // Scheduling for lowest register pressure. - Hybrid, // Scheduling for both latency and register pressure. - ILP, // Scheduling for ILP in low register pressure mode. - VLIW // Scheduling for VLIW targets. - }; +enum Preference { + None, // No preference + Source, // Follow source order. + RegPressure, // Scheduling for lowest register pressure. + Hybrid, // Scheduling for both latency and register pressure. + ILP, // Scheduling for ILP in low register pressure mode. + VLIW, // Scheduling for VLIW targets. + Fast, // Fast suboptimal list scheduling + Linearize, // Linearize DAG, no scheduling +}; } // end namespace Sched Index: clang/test/CodeGen/pre-ra-sched.c =================================================================== --- /dev/null +++ clang/test/CodeGen/pre-ra-sched.c @@ -0,0 +1,8 @@ +// RUN: %clang %s -mllvm -pre-RA-sched=fast -c -o - | FileCheck %s +// RUN: %clang %s -mllvm -pre-RA-sched=linearize -c -o - | FileCheck %s + +// CHECK-NOT: clang (LLVM option parsing): for the --pre-RA-sched option: Cannot find option named + +int main() { + return 0; +}
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits