2006-08-02 12:27:50 +00:00
|
|
|
//===-- llvm/CodeGen/SchedulerRegistry.h ------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 19:59:42 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2006-08-02 12:27:50 +00: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-29 23:29:43 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2006-08-02 12:27:50 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
///
|
|
|
|
/// RegisterScheduler class - Track the registration of instruction schedulers.
|
|
|
|
///
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
class SelectionDAGISel;
|
2009-02-11 04:27:20 +00:00
|
|
|
class ScheduleDAGSDNodes;
|
2006-08-02 12:27:50 +00:00
|
|
|
class SelectionDAG;
|
|
|
|
class MachineBasicBlock;
|
|
|
|
|
|
|
|
class RegisterScheduler : public MachinePassRegistryNode {
|
|
|
|
public:
|
2009-04-29 23:29:43 +00:00
|
|
|
typedef ScheduleDAGSDNodes *(*FunctionPassCtor)(SelectionDAGISel*,
|
|
|
|
CodeGenOpt::Level);
|
2006-08-02 12:27:50 +00: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 19:53:21 +00:00
|
|
|
/// createBURRListDAGScheduler - This creates a bottom up register usage
|
|
|
|
/// reduction list scheduler.
|
2009-02-11 04:27:20 +00:00
|
|
|
ScheduleDAGSDNodes *createBURRListDAGScheduler(SelectionDAGISel *IS,
|
2009-04-29 23:29:43 +00:00
|
|
|
CodeGenOpt::Level OptLevel);
|
2008-11-24 19:53:21 +00:00
|
|
|
|
|
|
|
/// createTDRRListDAGScheduler - This creates a top down register usage
|
|
|
|
/// reduction list scheduler.
|
2009-02-11 04:27:20 +00:00
|
|
|
ScheduleDAGSDNodes *createTDRRListDAGScheduler(SelectionDAGISel *IS,
|
2009-04-29 23:29:43 +00:00
|
|
|
CodeGenOpt::Level OptLevel);
|
2008-11-24 19:53:21 +00:00
|
|
|
|
2010-05-20 06:13:19 +00:00
|
|
|
/// createBURRListDAGScheduler - This creates a bottom up list scheduler that
|
|
|
|
/// schedules nodes in source code order when possible.
|
2010-01-23 10:26:57 +00:00
|
|
|
ScheduleDAGSDNodes *createSourceListDAGScheduler(SelectionDAGISel *IS,
|
|
|
|
CodeGenOpt::Level OptLevel);
|
|
|
|
|
2010-07-24 00:39:05 +00: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 06:13:19 +00:00
|
|
|
ScheduleDAGSDNodes *createHybridListDAGScheduler(SelectionDAGISel *IS,
|
|
|
|
CodeGenOpt::Level);
|
|
|
|
|
2010-07-24 00:39:05 +00: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);
|
2008-11-24 19:53:21 +00:00
|
|
|
/// createTDListDAGScheduler - This creates a top-down list scheduler with
|
|
|
|
/// a hazard recognizer.
|
2009-02-11 04:27:20 +00:00
|
|
|
ScheduleDAGSDNodes *createTDListDAGScheduler(SelectionDAGISel *IS,
|
2009-04-29 23:29:43 +00:00
|
|
|
CodeGenOpt::Level OptLevel);
|
2009-01-15 19:20:50 +00:00
|
|
|
|
2008-11-24 19:53:21 +00:00
|
|
|
/// createFastDAGScheduler - This creates a "fast" scheduler.
|
|
|
|
///
|
2009-02-11 04:27:20 +00:00
|
|
|
ScheduleDAGSDNodes *createFastDAGScheduler(SelectionDAGISel *IS,
|
2009-04-29 23:29:43 +00:00
|
|
|
CodeGenOpt::Level OptLevel);
|
2008-11-24 19:53:21 +00:00
|
|
|
|
|
|
|
/// createDefaultScheduler - This creates an instruction scheduler appropriate
|
|
|
|
/// for the target.
|
2009-02-11 04:27:20 +00:00
|
|
|
ScheduleDAGSDNodes *createDefaultScheduler(SelectionDAGISel *IS,
|
2009-04-29 23:29:43 +00:00
|
|
|
CodeGenOpt::Level OptLevel);
|
2008-11-24 19:53:21 +00:00
|
|
|
|
2006-08-02 12:27:50 +00:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|