[SelectionDAG] Make fast and linearize visible by clang -pre-RA-sched

ScheduleDAGFast.cpp is compiled to object file, but the ScheduleDAGFast
object file isn't linked into clang executable file as no symbol is
referred by outside. Add calling to createXxx of ScheduleDAGFast.cpp,
then the ScheduleDAGFast object file will be linked into clang
executable file. The static RegisterScheduler will register scheduler
fast and linearize at clang boot time.

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D101601
This commit is contained in:
Pan, Tao 2021-05-17 11:22:47 +08:00 committed by Wang, Pengfei
parent 7746e818a5
commit 976a3e5f61
3 changed files with 18 additions and 8 deletions

View File

@ -0,0 +1,4 @@
// 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

View File

@ -94,14 +94,16 @@ class Value;
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

View File

@ -270,6 +270,10 @@ namespace llvm {
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);