2006-08-02 14:27:50 +02:00
|
|
|
//===-- llvm/CodeGen/SchedulerRegistry.h ------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:59:42 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2006-08-02 14:27:50 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the implementation for instruction scheduler function
|
|
|
|
// pass registry (RegisterScheduler).
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2013-01-10 01:45:19 +01:00
|
|
|
#ifndef LLVM_CODEGEN_SCHEDULERREGISTRY_H
|
|
|
|
#define LLVM_CODEGEN_SCHEDULERREGISTRY_H
|
2006-08-02 14:27:50 +02:00
|
|
|
|
|
|
|
#include "llvm/CodeGen/MachinePassRegistry.h"
|
2009-04-30 01:29:43 +02:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2006-08-02 14:27:50 +02:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
///
|
|
|
|
/// RegisterScheduler class - Track the registration of instruction schedulers.
|
|
|
|
///
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
class SelectionDAGISel;
|
2009-02-11 05:27:20 +01:00
|
|
|
class ScheduleDAGSDNodes;
|
2006-08-02 14:27:50 +02:00
|
|
|
class SelectionDAG;
|
|
|
|
class MachineBasicBlock;
|
|
|
|
|
|
|
|
class RegisterScheduler : public MachinePassRegistryNode {
|
|
|
|
public:
|
2009-04-30 01:29:43 +02:00
|
|
|
typedef ScheduleDAGSDNodes *(*FunctionPassCtor)(SelectionDAGISel*,
|
|
|
|
CodeGenOpt::Level);
|
2006-08-02 14:27:50 +02:00
|
|
|
|
|
|
|
static MachinePassRegistry Registry;
|
|
|
|
|
|
|
|
RegisterScheduler(const char *N, const char *D, FunctionPassCtor C)
|
|
|
|
: MachinePassRegistryNode(N, D, (MachinePassCtor)C)
|
|
|
|
{ Registry.Add(this); }
|
|
|
|
~RegisterScheduler() { Registry.Remove(this); }
|
2012-02-01 23:13:57 +01:00
|
|
|
|
2006-08-02 14:27:50 +02:00
|
|
|
|
|
|
|
// Accessors.
|
|
|
|
//
|
|
|
|
RegisterScheduler *getNext() const {
|
|
|
|
return (RegisterScheduler *)MachinePassRegistryNode::getNext();
|
|
|
|
}
|
|
|
|
static RegisterScheduler *getList() {
|
|
|
|
return (RegisterScheduler *)Registry.getList();
|
|
|
|
}
|
|
|
|
static void setListener(MachinePassRegistryListener *L) {
|
|
|
|
Registry.setListener(L);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2008-11-24 20:53:21 +01:00
|
|
|
/// createBURRListDAGScheduler - This creates a bottom up register usage
|
|
|
|
/// reduction list scheduler.
|
2009-02-11 05:27:20 +01:00
|
|
|
ScheduleDAGSDNodes *createBURRListDAGScheduler(SelectionDAGISel *IS,
|
2009-04-30 01:29:43 +02:00
|
|
|
CodeGenOpt::Level OptLevel);
|
2008-11-24 20:53:21 +01:00
|
|
|
|
2010-05-20 08:13:19 +02:00
|
|
|
/// createBURRListDAGScheduler - This creates a bottom up list scheduler that
|
|
|
|
/// schedules nodes in source code order when possible.
|
2010-01-23 11:26:57 +01:00
|
|
|
ScheduleDAGSDNodes *createSourceListDAGScheduler(SelectionDAGISel *IS,
|
|
|
|
CodeGenOpt::Level OptLevel);
|
|
|
|
|
2010-07-24 02:39:05 +02:00
|
|
|
/// createHybridListDAGScheduler - This creates a bottom up register pressure
|
|
|
|
/// aware list scheduler that make use of latency information to avoid stalls
|
|
|
|
/// for long latency instructions in low register pressure mode. In high
|
|
|
|
/// register pressure mode it schedules to reduce register pressure.
|
2010-05-20 08:13:19 +02:00
|
|
|
ScheduleDAGSDNodes *createHybridListDAGScheduler(SelectionDAGISel *IS,
|
|
|
|
CodeGenOpt::Level);
|
|
|
|
|
2010-07-24 02:39:05 +02:00
|
|
|
/// createILPListDAGScheduler - This creates a bottom up register pressure
|
|
|
|
/// aware list scheduler that tries to increase instruction level parallelism
|
|
|
|
/// in low register pressure mode. In high register pressure mode it schedules
|
|
|
|
/// to reduce register pressure.
|
|
|
|
ScheduleDAGSDNodes *createILPListDAGScheduler(SelectionDAGISel *IS,
|
|
|
|
CodeGenOpt::Level);
|
2009-01-15 20:20:50 +01:00
|
|
|
|
2008-11-24 20:53:21 +01:00
|
|
|
/// createFastDAGScheduler - This creates a "fast" scheduler.
|
|
|
|
///
|
2009-02-11 05:27:20 +01:00
|
|
|
ScheduleDAGSDNodes *createFastDAGScheduler(SelectionDAGISel *IS,
|
2009-04-30 01:29:43 +02:00
|
|
|
CodeGenOpt::Level OptLevel);
|
2008-11-24 20:53:21 +01:00
|
|
|
|
2012-02-01 23:13:57 +01:00
|
|
|
/// createVLIWDAGScheduler - Scheduler for VLIW targets. This creates top down
|
|
|
|
/// DFA driven list scheduler with clustering heuristic to control
|
|
|
|
/// register pressure.
|
|
|
|
ScheduleDAGSDNodes *createVLIWDAGScheduler(SelectionDAGISel *IS,
|
|
|
|
CodeGenOpt::Level OptLevel);
|
2008-11-24 20:53:21 +01:00
|
|
|
/// createDefaultScheduler - This creates an instruction scheduler appropriate
|
|
|
|
/// for the target.
|
2009-02-11 05:27:20 +01:00
|
|
|
ScheduleDAGSDNodes *createDefaultScheduler(SelectionDAGISel *IS,
|
2009-04-30 01:29:43 +02:00
|
|
|
CodeGenOpt::Level OptLevel);
|
2008-11-24 20:53:21 +01:00
|
|
|
|
2012-10-17 21:39:36 +02:00
|
|
|
/// createDAGLinearizer - This creates a "no-scheduling" scheduler which
|
|
|
|
/// linearize the DAG using topological order.
|
|
|
|
ScheduleDAGSDNodes *createDAGLinearizer(SelectionDAGISel *IS,
|
|
|
|
CodeGenOpt::Level OptLevel);
|
|
|
|
|
2006-08-02 14:27:50 +02:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|