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).
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CODEGENSCHEDULERREGISTRY_H
|
|
|
|
#define LLVM_CODEGENSCHEDULERREGISTRY_H
|
|
|
|
|
|
|
|
#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); }
|
|
|
|
|
|
|
|
|
|
|
|
// Accessors.
|
|
|
|
//
|
|
|
|
RegisterScheduler *getNext() const {
|
|
|
|
return (RegisterScheduler *)MachinePassRegistryNode::getNext();
|
|
|
|
}
|
|
|
|
static RegisterScheduler *getList() {
|
|
|
|
return (RegisterScheduler *)Registry.getList();
|
|
|
|
}
|
|
|
|
static FunctionPassCtor getDefault() {
|
|
|
|
return (FunctionPassCtor)Registry.getDefault();
|
|
|
|
}
|
|
|
|
static void setDefault(FunctionPassCtor C) {
|
|
|
|
Registry.setDefault((MachinePassCtor)C);
|
|
|
|
}
|
|
|
|
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
|
|
|
|
|
|
|
/// createTDRRListDAGScheduler - This creates a top down register usage
|
|
|
|
/// reduction list scheduler.
|
2009-02-11 05:27:20 +01:00
|
|
|
ScheduleDAGSDNodes *createTDRRListDAGScheduler(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-05-20 08:13:19 +02:00
|
|
|
/// createHybridListDAGScheduler - This creates a bottom up hybrid register
|
|
|
|
/// usage reduction list scheduler that make use of latency information to
|
|
|
|
/// avoid stalls for long latency instructions.
|
|
|
|
ScheduleDAGSDNodes *createHybridListDAGScheduler(SelectionDAGISel *IS,
|
|
|
|
CodeGenOpt::Level);
|
|
|
|
|
2008-11-24 20:53:21 +01:00
|
|
|
/// createTDListDAGScheduler - This creates a top-down list scheduler with
|
|
|
|
/// a hazard recognizer.
|
2009-02-11 05:27:20 +01:00
|
|
|
ScheduleDAGSDNodes *createTDListDAGScheduler(SelectionDAGISel *IS,
|
2009-04-30 01:29:43 +02:00
|
|
|
CodeGenOpt::Level OptLevel);
|
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
|
|
|
|
|
|
|
/// 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
|
|
|
|
2006-08-02 14:27:50 +02:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|