LLVM API Documentation

llvm::ScheduleDAGSDNodes Class Reference

#include <ScheduleDAGSDNodes.h>

Inheritance diagram for llvm::ScheduleDAGSDNodes:
[legend]
Collaboration diagram for llvm::ScheduleDAGSDNodes:
[legend]

List of all members.

Public Member Functions

 ScheduleDAGSDNodes (MachineFunction &mf)
virtual ~ScheduleDAGSDNodes ()
void Run (SelectionDAG *dag, MachineBasicBlock *bb, MachineBasicBlock::iterator insertPos)
SUnit * NewSUnit (SDNode *N)
SUnit * Clone (SUnit *N)
virtual void BuildSchedGraph ()
virtual void ComputeLatency (SUnit *SU)
void EmitNode (SDNode *Node, bool IsClone, bool HasClone, DenseMap< SDValue, unsigned > &VRBaseMap)
virtual MachineBasicBlock * EmitSchedule ()
 EmitSchedule - Emit the machine code in scheduled order.
virtual void Schedule ()=0
virtual void dumpNode (const SUnit *SU) const
virtual std::string getGraphNodeLabel (const SUnit *SU) const
virtual void getCustomGraphFeatures (GraphWriter< ScheduleDAG * > &GW) const

Static Public Member Functions

static bool isPassiveNode (SDNode *Node)
static unsigned CountResults (SDNode *Node)
static unsigned CountOperands (SDNode *Node)
static unsigned ComputeMemOperandsEnd (SDNode *Node)

Public Attributes

SelectionDAG * DAG


Detailed Description

ScheduleDAGSDNodes - A ScheduleDAG for scheduling SDNode-based DAGs.

Edges between SUnits are initially based on edges in the SelectionDAG, and additional edges can be added by the schedulers as heuristics. SDNodes such as Constants, Registers, and a few others that are not interesting to schedulers are not allocated SUnits.

SDNodes with MVT::Flag operands are grouped along with the flagged nodes into a single SUnit so that they are scheduled together.

SDNode-based scheduling graphs do not use SDep::Anti or SDep::Output edges. Physical register dependence information is not carried in the DAG and must be handled explicitly by schedulers.

Definition at line 36 of file ScheduleDAGSDNodes.h.


Constructor & Destructor Documentation

ScheduleDAGSDNodes::ScheduleDAGSDNodes ( MachineFunction &  mf  )  [explicit]

Definition at line 26 of file ScheduleDAGSDNodes.cpp.

virtual llvm::ScheduleDAGSDNodes::~ScheduleDAGSDNodes (  )  [inline, virtual]

Definition at line 42 of file ScheduleDAGSDNodes.h.


Member Function Documentation

void ScheduleDAGSDNodes::Run ( SelectionDAG *  dag,
MachineBasicBlock *  bb,
MachineBasicBlock::iterator  insertPos 
)

Run - perform scheduling.

Definition at line 32 of file ScheduleDAGSDNodes.cpp.

References DAG, and llvm::ScheduleDAG::Run().

static bool llvm::ScheduleDAGSDNodes::isPassiveNode ( SDNode *  Node  )  [inline, static]

isPassiveNode - Return true if the node is a non-scheduled leaf.

Definition at line 51 of file ScheduleDAGSDNodes.h.

References llvm::ISD::EntryToken, and llvm::SDNode::getOpcode().

SUnit* llvm::ScheduleDAGSDNodes::NewSUnit ( SDNode *  N  )  [inline]

NewSUnit - Creates a new SUnit and return a ptr to it.

Definition at line 68 of file ScheduleDAGSDNodes.h.

References llvm::ScheduleDAG::SUnits.

Referenced by Clone().

SUnit * ScheduleDAGSDNodes::Clone ( SUnit *  N  ) 

Clone - Creates a clone of the specified SUnit. It does not copy the predecessors / successors info nor the temporary scheduling states.

Definition at line 38 of file ScheduleDAGSDNodes.cpp.

References llvm::SUnit::getNode(), llvm::SUnit::hasPhysRegClobbers, llvm::SUnit::hasPhysRegDefs, llvm::SUnit::isCloned, llvm::SUnit::isCommutable, llvm::SUnit::isTwoAddress, llvm::SUnit::Latency, NewSUnit(), and llvm::SUnit::OrigNode.

void ScheduleDAGSDNodes::BuildSchedGraph (  )  [virtual]

BuildSchedGraph - Build the SUnit graph from the selection dag that we are input. This SUnit graph is similar to the SelectionDAG, but excludes nodes that aren't interesting to scheduling, and represents flagged together nodes with a single SUnit.

BuildSchedGraph - Build the SUnit graph from the selection dag that we are input. This SUnit graph is similar to the SelectionDAG, but excludes nodes that aren't interesting to scheduling, and represents flagged together nodes with a single SUnit.

Implements llvm::ScheduleDAG.

Definition at line 233 of file ScheduleDAGSDNodes.cpp.

void ScheduleDAGSDNodes::ComputeLatency ( SUnit *  SU  )  [virtual]

unsigned ScheduleDAGSDNodes::CountResults ( SDNode *  Node  )  [static]

CountResults - The results of target nodes have register or immediate operands first, then an optional chain, and optional flag operands (which do not go into the machine instrs.)

CountResults - The results of target nodes have register or immediate operands first, then an optional chain, and optional flag operands (which do not go into the resulting MachineInstr).

Definition at line 258 of file ScheduleDAGSDNodes.cpp.

References llvm::MVT::Flag, llvm::SDNode::getNumValues(), llvm::SDNode::getValueType(), and llvm::MVT::Other.

Referenced by EmitNode().

unsigned ScheduleDAGSDNodes::CountOperands ( SDNode *  Node  )  [static]

CountOperands - The inputs to target nodes have any actual inputs first, followed by special operands that describe memory references, then an optional chain operand, then flag operands. Compute the number of actual operands that will go into the resulting MachineInstr.

CountOperands - The inputs to target nodes have any actual inputs first, followed by special operands that describe memory references, then an optional chain operand, then an optional flag operand. Compute the number of actual operands that will go into the resulting MachineInstr.

Definition at line 271 of file ScheduleDAGSDNodes.cpp.

References ComputeMemOperandsEnd(), llvm::SDValue::getNode(), and llvm::SDNode::getOperand().

Referenced by EmitNode().

unsigned ScheduleDAGSDNodes::ComputeMemOperandsEnd ( SDNode *  Node  )  [static]

ComputeMemOperandsEnd - Find the index one past the last MemOperandSDNode operand

ComputeMemOperandsEnd - Find the index one past the last MemOperandSDNode operand

Definition at line 280 of file ScheduleDAGSDNodes.cpp.

References llvm::MVT::Flag, llvm::SDNode::getNumOperands(), llvm::SDNode::getOperand(), llvm::SDValue::getValueType(), and llvm::MVT::Other.

Referenced by CountOperands(), and EmitNode().

void ScheduleDAGSDNodes::EmitNode ( SDNode *  Node,
bool  IsClone,
bool  IsCloned,
DenseMap< SDValue, unsigned > &  VRBaseMap 
)

EmitNode - Generate machine code for an node and needed dependencies. VRBaseMap contains, for each already emitted node, the first virtual register number for the results of the node.

EmitNode - Generate machine code for an node and needed dependencies.

Definition at line 472 of file ScheduleDAGSDNodesEmit.cpp.

References llvm::ScheduleDAG::AddMemOperand(), llvm::MachineInstr::addOperand(), llvm::ScheduleDAG::BB, llvm::BuildMI(), ComputeMemOperandsEnd(), llvm::TargetInstrInfo::COPY_TO_REGCLASS, llvm::ISD::CopyFromReg, llvm::TargetInstrInfo::copyRegToReg(), llvm::ISD::CopyToReg, CountOperands(), CountResults(), llvm::MachineOperand::CreateES(), llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateReg(), DAG, llvm::SDNode::dump(), llvm::TargetLowering::EmitInstrWithCustomInserter(), llvm::MachineBasicBlock::end(), llvm::ISD::EntryToken, llvm::TargetInstrInfo::EXTRACT_SUBREG, llvm::MVT::Flag, llvm::TargetInstrInfo::get(), llvm::SDNode::getDebugLoc(), llvm::TargetInstrDesc::getImplicitDefs(), llvm::SDNode::getMachineOpcode(), llvm::TargetInstrDesc::getNumDefs(), llvm::InlineAsm::getNumOperandRegisters(), llvm::SDNode::getNumOperands(), llvm::TargetInstrDesc::getNumOperands(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::TargetRegisterInfo::getPhysicalRegisterRegClass(), llvm::MachineRegisterInfo::getRegClass(), llvm::SDValue::getValueType(), llvm::SDNode::hasAnyUseOfValue(), llvm::TargetInstrInfo::IMPLICIT_DEF, llvm::TargetInstrInfo::INLINEASM, llvm::ISD::INLINEASM, llvm::MachineBasicBlock::insert(), llvm::TargetInstrInfo::INSERT_SUBREG, llvm::ScheduleDAG::InsertPos, llvm::SDNode::isMachineOpcode(), llvm::TargetInstrDesc::isVariadic(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm_unreachable, llvm::ISD::MERGE_VALUES, llvm::ScheduleDAG::MF, llvm::ScheduleDAG::MRI, R, llvm::TargetInstrInfo::SUBREG_TO_REG, llvm::ScheduleDAG::TII, llvm::ScheduleDAG::TLI, llvm::ISD::TokenFactor, llvm::ScheduleDAG::TRI, and llvm::TargetInstrDesc::usesCustomDAGSchedInsertionHook().

Referenced by EmitSchedule().

MachineBasicBlock * ScheduleDAGSDNodes::EmitSchedule (  )  [virtual]

virtual void llvm::ScheduleDAGSDNodes::Schedule (  )  [pure virtual]

Schedule - Order nodes according to selected style, filling in the Sequence member.

Implements llvm::ScheduleDAG.

void ScheduleDAGSDNodes::dumpNode ( const SUnit *  SU  )  const [virtual]

std::string ScheduleDAGSDNodes::getGraphNodeLabel ( const SUnit *  SU  )  const [virtual]

void ScheduleDAGSDNodes::getCustomGraphFeatures ( GraphWriter< ScheduleDAG * > &  GW  )  const [virtual]


Member Data Documentation


The documentation for this class was generated from the following files: