LLVM API Documentation

ScheduleDAGRRList.cpp File Reference

#include "ScheduleDAGSDNodes.h"
#include "llvm/CodeGen/SchedulerRegistry.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/ADT/PriorityQueue.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/STLExtras.h"
#include <climits>

Include dependency graph for ScheduleDAGRRList.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "pre-RA-sched"

Typedefs

typedef
RegReductionPriorityQueue
< bu_ls_rr_sort > 
BURegReductionPriorityQueue
typedef
RegReductionPriorityQueue
< td_ls_rr_sort > 
TDRegReductionPriorityQueue

Functions

 STATISTIC (NumBacktracks,"Number of times scheduler backtracked")
 STATISTIC (NumUnfolds,"Number of nodes unfolded")
 STATISTIC (NumDups,"Number of duplicated nodes")
 STATISTIC (NumPRCopies,"Number of physical register copies")
static EVT getPhysicalRegisterVT (SDNode *N, unsigned Reg, const TargetInstrInfo *TII)
static bool CheckForLiveRegDef (SUnit *SU, unsigned Reg, std::vector< SUnit * > &LiveRegDefs, SmallSet< unsigned, 4 > &RegAdded, SmallVector< unsigned, 4 > &LRegs, const TargetRegisterInfo *TRI)
static unsigned CalcNodeSethiUllmanNumber (const SUnit *SU, std::vector< unsigned > &SUNumbers)
static unsigned closestSucc (const SUnit *SU)
static unsigned calcMaxScratches (const SUnit *SU)
static bool hasCopyToRegUse (const SUnit *SU)
static bool canClobberPhysRegDefs (const SUnit *SuccSU, const SUnit *SU, const TargetInstrInfo *TII, const TargetRegisterInfo *TRI)
static unsigned LimitedSumOfUnscheduledPredsOfSuccs (const SUnit *SU, unsigned Limit)
ScheduleDAGSDNodes * llvm::createBURRListDAGScheduler (SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)
ScheduleDAGSDNodes * llvm::createTDRRListDAGScheduler (SelectionDAGISel *IS, CodeGenOpt::Level OptLevel)

Variables

static RegisterScheduler burrListDAGScheduler ("list-burr","Bottom-up register reduction list scheduling", createBURRListDAGScheduler)
static RegisterScheduler tdrListrDAGScheduler ("list-tdrr","Top-down register reduction list scheduling", createTDRRListDAGScheduler)


Define Documentation

#define DEBUG_TYPE   "pre-RA-sched"

Definition at line 18 of file ScheduleDAGRRList.cpp.


Typedef Documentation

typedef RegReductionPriorityQueue<bu_ls_rr_sort> BURegReductionPriorityQueue [static]

Definition at line 1084 of file ScheduleDAGRRList.cpp.

typedef RegReductionPriorityQueue<td_ls_rr_sort> TDRegReductionPriorityQueue [static]

Definition at line 1087 of file ScheduleDAGRRList.cpp.


Function Documentation

static unsigned calcMaxScratches ( const SUnit *  SU  )  [static]

calcMaxScratches - Returns an cost estimate of the worse case requirement for scratch registers, i.e. number of data dependencies.

Definition at line 1111 of file ScheduleDAGRRList.cpp.

References E, and llvm::SUnit::Preds.

static unsigned CalcNodeSethiUllmanNumber ( const SUnit *  SU,
std::vector< unsigned > &  SUNumbers 
) [static]

CalcNodeSethiUllmanNumber - Compute Sethi Ullman number. Smaller number is the higher priority.

Definition at line 938 of file ScheduleDAGRRList.cpp.

References E, llvm::SUnit::NodeNum, and llvm::SUnit::Preds.

static bool canClobberPhysRegDefs ( const SUnit *  SuccSU,
const SUnit *  SU,
const TargetInstrInfo *  TII,
const TargetRegisterInfo *  TRI 
) [static]

static bool CheckForLiveRegDef ( SUnit *  SU,
unsigned  Reg,
std::vector< SUnit * > &  LiveRegDefs,
SmallSet< unsigned, 4 > &  RegAdded,
SmallVector< unsigned, 4 > &  LRegs,
const TargetRegisterInfo *  TRI 
) [static]

CheckForLiveRegDef - Return true and update live register vector if the specified register def of the specified SUnit clobbers any "live" registers.

Definition at line 589 of file ScheduleDAGRRList.cpp.

References llvm::TargetRegisterInfo::getAliasSet(), llvm::SmallSet< T, N >::insert(), and llvm::SmallVectorImpl< T >::push_back().

static unsigned closestSucc ( const SUnit *  SU  )  [static]

closestSucc - Returns the scheduled cycle of the successor which is closest to the current cycle.

Definition at line 1092 of file ScheduleDAGRRList.cpp.

References llvm::ISD::CopyToReg, E, and llvm::SUnit::Succs.

static EVT getPhysicalRegisterVT ( SDNode *  N,
unsigned  Reg,
const TargetInstrInfo *  TII 
) [static]

getPhysicalRegisterVT - Returns the ValueType of the physical register definition of the specified node. FIXME: Move to SelectionDAG?

Definition at line 574 of file ScheduleDAGRRList.cpp.

References llvm::TargetInstrInfo::get(), llvm::TargetInstrDesc::getImplicitDefs(), llvm::SDNode::getMachineOpcode(), llvm::TargetInstrDesc::getNumDefs(), llvm::SDNode::getValueType(), and llvm::TargetInstrDesc::ImplicitDefs.

static bool hasCopyToRegUse ( const SUnit *  SU  )  [static]

hasCopyToRegUse - Return true if SU has a value successor that is a CopyToReg node.

Definition at line 1190 of file ScheduleDAGRRList.cpp.

References llvm::ISD::CopyToReg, E, llvm::SUnit::getNode(), llvm::SDNode::getOpcode(), and llvm::SUnit::Succs.

static unsigned LimitedSumOfUnscheduledPredsOfSuccs ( const SUnit *  SU,
unsigned  Limit 
) [static]

LimitedSumOfUnscheduledPredsOfSuccs - Compute the sum of the unscheduled predecessors of the successors of the SUnit SU. Stop when the provided limit is exceeded.

Definition at line 1447 of file ScheduleDAGRRList.cpp.

References E, II, llvm::SUnit::isScheduled, llvm::SUnit::Preds, and llvm::SUnit::Succs.

STATISTIC ( NumPRCopies  ,
"Number of physical register copies"   
)

STATISTIC ( NumDups  ,
"Number of duplicated nodes"   
)

STATISTIC ( NumUnfolds  ,
"Number of nodes unfolded"   
)

STATISTIC ( NumBacktracks  ,
"Number of times scheduler backtracked"   
)


Variable Documentation

AvailableQueue - The priority queue to use for the available SUnits.

Definition at line 62 of file ScheduleDAGRRList.cpp.

RegisterScheduler burrListDAGScheduler("list-burr","Bottom-up register reduction list scheduling", createBURRListDAGScheduler) [static]

Definition at line 969 of file ScheduleDAGRRList.cpp.

isBottomUp - This is true if the scheduling problem is bottom-up, false if it is top-down.

Definition at line 59 of file ScheduleDAGRRList.cpp.

Referenced by llvm::ScheduleDAG::VerifySchedule().

std::vector<unsigned> LiveRegCycles

Definition at line 69 of file ScheduleDAGRRList.cpp.

std::vector<SUnit*> LiveRegDefs

Definition at line 68 of file ScheduleDAGRRList.cpp.

LiveRegDefs - A set of physical registers and their definition that are "live". These nodes must be scheduled before any other nodes that modifies the registers can be scheduled.

Definition at line 67 of file ScheduleDAGRRList.cpp.

PriorityQueue<SUnit*, std::vector<SUnit*>, SF> Queue

Definition at line 968 of file ScheduleDAGRRList.cpp.

ScheduleDAGRRList* scheduleDAG

Definition at line 977 of file ScheduleDAGRRList.cpp.

Definition at line 980 of file ScheduleDAGRRList.cpp.

RegReductionPriorityQueue<td_ls_rr_sort>* SPQ

Definition at line 919 of file ScheduleDAGRRList.cpp.

std::vector<SUnit>* SUnits

RegisterScheduler tdrListrDAGScheduler("list-tdrr","Top-down register reduction list scheduling", createTDRRListDAGScheduler) [static]

Definition at line 975 of file ScheduleDAGRRList.cpp.

Topo - A topological ordering for SUnits which permits fast IsReachable and similar queries.

Definition at line 73 of file ScheduleDAGRRList.cpp.

Definition at line 976 of file ScheduleDAGRRList.cpp.