[llvm-commits] CVS: llvm/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp SchedGraph.cpp SchedGraph.h SchedGraphCommon.cpp SchedPriorities.cpp SchedPriorities.h
Jeff Cohen
jeffc at jolt-lang.org
Tue Jul 26 22:54:01 PDT 2005
Changes in directory llvm/lib/Target/SparcV9/InstrSched:
InstrScheduling.cpp updated: 1.83 -> 1.84
SchedGraph.cpp updated: 1.69 -> 1.70
SchedGraph.h updated: 1.41 -> 1.42
SchedGraphCommon.cpp updated: 1.9 -> 1.10
SchedPriorities.cpp updated: 1.37 -> 1.38
SchedPriorities.h updated: 1.29 -> 1.30
---
Log message:
Eliminate tabs and trailing spaces.
---
Diffs of the changes: (+258 -258)
InstrScheduling.cpp | 220 +++++++++++++++++++++++++--------------------------
SchedGraph.cpp | 88 ++++++++++----------
SchedGraph.h | 48 +++++------
SchedGraphCommon.cpp | 54 ++++++------
SchedPriorities.cpp | 26 +++---
SchedPriorities.h | 80 +++++++++---------
6 files changed, 258 insertions(+), 258 deletions(-)
Index: llvm/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp
diff -u llvm/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp:1.83 llvm/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp:1.84
--- llvm/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp:1.83 Fri May 13 14:42:31 2005
+++ llvm/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp Wed Jul 27 00:53:43 2005
@@ -68,15 +68,15 @@
private:
friend class InstrSchedule;
- inline void addInstr(const SchedGraphNode* node, unsigned int slotNum) {
+ inline void addInstr(const SchedGraphNode* node, unsigned int slotNum) {
assert(slotNum < group.size());
group[slotNum] = node;
}
- /*ctor*/ InstrGroup(unsigned int nslots)
+ /*ctor*/ InstrGroup(unsigned int nslots)
: group(nslots, NULL) {}
- /*ctor*/ InstrGroup(); // disable: DO NOT IMPLEMENT
+ /*ctor*/ InstrGroup(); // disable: DO NOT IMPLEMENT
private:
std::vector<const SchedGraphNode*> group;
@@ -100,8 +100,8 @@
typedef ScheduleIterator<_NodeType> _Self;
/*ctor*/ inline ScheduleIterator(const InstrSchedule& _schedule,
- unsigned _cycleNum,
- unsigned _slotNum)
+ unsigned _cycleNum,
+ unsigned _slotNum)
: cycleNum(_cycleNum), slotNum(_slotNum), S(_schedule) {
skipToNextInstr();
}
@@ -118,8 +118,8 @@
inline _NodeType* operator*() const;
inline _NodeType* operator->() const { return operator*(); }
- _Self& operator++(); // Preincrement
- inline _Self operator++(int) { // Postincrement
+ _Self& operator++(); // Preincrement
+ inline _Self operator++(int) { // Postincrement
_Self tmp(*this); ++*this; return tmp;
}
@@ -128,7 +128,7 @@
private:
inline _Self& operator=(const _Self& x); // DISABLE -- DO NOT IMPLEMENT
- void skipToNextInstr();
+ void skipToNextInstr();
};
@@ -141,8 +141,8 @@
class InstrSchedule {
const unsigned int nslots;
unsigned int numInstr;
- std::vector<InstrGroup*> groups; // indexed by cycle number
- std::vector<CycleCount_t> startTime; // indexed by node id
+ std::vector<InstrGroup*> groups; // indexed by cycle number
+ std::vector<CycleCount_t> startTime; // indexed by node id
InstrSchedule(InstrSchedule&); // DO NOT IMPLEMENT
void operator=(InstrSchedule&); // DO NOT IMPLEMENT
@@ -157,18 +157,18 @@
const_iterator end() const { return const_iterator::end(*this); }
public: // constructors and destructor
- /*ctor*/ InstrSchedule (unsigned int _nslots,
- unsigned int _numNodes);
- /*dtor*/ ~InstrSchedule ();
+ /*ctor*/ InstrSchedule (unsigned int _nslots,
+ unsigned int _numNodes);
+ /*dtor*/ ~InstrSchedule ();
public: // accessor functions to query chosen schedule
- const SchedGraphNode* getInstr (unsigned int slotNum,
- CycleCount_t c) {
+ const SchedGraphNode* getInstr (unsigned int slotNum,
+ CycleCount_t c) {
const InstrGroup* igroup = this->getIGroup(c);
return (igroup == NULL)? NULL : (*igroup)[slotNum];
}
- inline InstrGroup* getIGroup (CycleCount_t c) {
+ inline InstrGroup* getIGroup (CycleCount_t c) {
if ((unsigned)c >= groups.size())
groups.resize(c+1);
if (groups[c] == NULL)
@@ -176,23 +176,23 @@
return groups[c];
}
- inline const InstrGroup* getIGroup (CycleCount_t c) const {
+ inline const InstrGroup* getIGroup (CycleCount_t c) const {
assert((unsigned)c < groups.size());
return groups[c];
}
- inline CycleCount_t getStartTime (unsigned int nodeId) const {
+ inline CycleCount_t getStartTime (unsigned int nodeId) const {
assert(nodeId < startTime.size());
return startTime[nodeId];
}
- unsigned int getNumInstructions() const {
+ unsigned int getNumInstructions() const {
return numInstr;
}
- inline void scheduleInstr (const SchedGraphNode* node,
- unsigned int slotNum,
- CycleCount_t cycle) {
+ inline void scheduleInstr (const SchedGraphNode* node,
+ unsigned int slotNum,
+ CycleCount_t cycle) {
InstrGroup* igroup = this->getIGroup(cycle);
if (!((*igroup)[slotNum] == NULL)) {
std::cerr << "Slot already filled?\n";
@@ -207,7 +207,7 @@
private:
friend class ScheduleIterator<SchedGraphNode>;
friend class ScheduleIterator<const SchedGraphNode>;
- /*ctor*/ InstrSchedule (); // Disable: DO NOT IMPLEMENT.
+ /*ctor*/ InstrSchedule (); // Disable: DO NOT IMPLEMENT.
};
template<class NodeType>
@@ -221,8 +221,8 @@
InstrSchedule::InstrSchedule(unsigned int _nslots, unsigned int _numNodes)
: nslots(_nslots),
numInstr(0),
- groups(2 * _numNodes / _nslots), // 2 x lower-bound for #cycles
- startTime(_numNodes, (CycleCount_t) -1) // set all to -1
+ groups(2 * _numNodes / _nslots), // 2 x lower-bound for #cycles
+ startTime(_numNodes, (CycleCount_t) -1) // set all to -1
{
}
@@ -232,7 +232,7 @@
{
for (unsigned c=0, NC=groups.size(); c < NC; c++)
if (groups[c] != NULL)
- delete groups[c]; // delete InstrGroup objects
+ delete groups[c]; // delete InstrGroup objects
}
@@ -242,17 +242,17 @@
ScheduleIterator<_NodeType>::skipToNextInstr()
{
while(cycleNum < S.groups.size() && S.groups[cycleNum] == NULL)
- ++cycleNum; // skip cycles with no instructions
+ ++cycleNum; // skip cycles with no instructions
while (cycleNum < S.groups.size() &&
- (*S.groups[cycleNum])[slotNum] == NULL)
+ (*S.groups[cycleNum])[slotNum] == NULL)
{
++slotNum;
if (slotNum == S.nslots) {
++cycleNum;
slotNum = 0;
while(cycleNum < S.groups.size() && S.groups[cycleNum] == NULL)
- ++cycleNum; // skip cycles with no instructions
+ ++cycleNum; // skip cycles with no instructions
}
}
}
@@ -260,7 +260,7 @@
template<class _NodeType>
inline
ScheduleIterator<_NodeType>&
-ScheduleIterator<_NodeType>::operator++() // Preincrement
+ScheduleIterator<_NodeType>::operator++() // Preincrement
{
++slotNum;
if (slotNum == S.nslots) {
@@ -303,12 +303,12 @@
DelaySlotInfo(const DelaySlotInfo &); // DO NOT IMPLEMENT
void operator=(const DelaySlotInfo&); // DO NOT IMPLEMENT
public:
- /*ctor*/ DelaySlotInfo (const SchedGraphNode* _brNode,
- unsigned _ndelays)
+ /*ctor*/ DelaySlotInfo (const SchedGraphNode* _brNode,
+ unsigned _ndelays)
: brNode(_brNode), ndelays(_ndelays),
delayedNodeCycle(0), delayedNodeSlotNum(0) {}
- inline unsigned getNumDelays () {
+ inline unsigned getNumDelays () {
return ndelays;
}
@@ -316,17 +316,17 @@
return delayNodeVec;
}
- inline void addDelayNode (const SchedGraphNode* node) {
+ inline void addDelayNode (const SchedGraphNode* node) {
delayNodeVec.push_back(node);
assert(delayNodeVec.size() <= ndelays && "Too many delay slot instrs!");
}
- inline void recordChosenSlot (CycleCount_t cycle, unsigned slotNum) {
+ inline void recordChosenSlot (CycleCount_t cycle, unsigned slotNum) {
delayedNodeCycle = cycle;
delayedNodeSlotNum = slotNum;
}
- unsigned scheduleDelayedNode (SchedulingManager& S);
+ unsigned scheduleDelayedNode (SchedulingManager& S);
};
@@ -348,14 +348,14 @@
private:
unsigned totalInstrCount;
CycleCount_t curTime;
- CycleCount_t nextEarliestIssueTime; // next cycle we can issue
+ CycleCount_t nextEarliestIssueTime; // next cycle we can issue
// indexed by slot#
std::vector<hash_set<const SchedGraphNode*> > choicesForSlot;
- std::vector<const SchedGraphNode*> choiceVec; // indexed by node ptr
- std::vector<int> numInClass; // indexed by sched class
- std::vector<CycleCount_t> nextEarliestStartTime; // indexed by opCode
+ std::vector<const SchedGraphNode*> choiceVec; // indexed by node ptr
+ std::vector<int> numInClass; // indexed by sched class
+ std::vector<CycleCount_t> nextEarliestStartTime; // indexed by opCode
hash_map<const SchedGraphNode*, DelaySlotInfo*> delaySlotInfoForBranches;
- // indexed by branch node ptr
+ // indexed by branch node ptr
public:
SchedulingManager(const TargetMachine& _target, const SchedGraph* graph,
@@ -371,7 +371,7 @@
// Simplify access to the machine instruction info
//----------------------------------------------------------------------
- inline const TargetInstrInfo& getInstrInfo () const {
+ inline const TargetInstrInfo& getInstrInfo () const {
return schedInfo.getInstrInfo();
}
@@ -379,21 +379,21 @@
// Interface for checking and updating the current time
//----------------------------------------------------------------------
- inline CycleCount_t getTime () const {
+ inline CycleCount_t getTime () const {
return curTime;
}
- inline CycleCount_t getEarliestIssueTime() const {
+ inline CycleCount_t getEarliestIssueTime() const {
return nextEarliestIssueTime;
}
- inline CycleCount_t getEarliestStartTimeForOp(MachineOpCode opCode) const {
+ inline CycleCount_t getEarliestStartTimeForOp(MachineOpCode opCode) const {
assert(opCode < (int) nextEarliestStartTime.size());
return nextEarliestStartTime[opCode];
}
// Update current time to specified cycle
- inline void updateTime (CycleCount_t c) {
+ inline void updateTime (CycleCount_t c) {
curTime = c;
schedPrio.updateTime(c);
}
@@ -406,17 +406,17 @@
// between choices for a single cycle
//----------------------------------------------------------------------
- inline unsigned int getNumChoices () const {
+ inline unsigned int getNumChoices () const {
return choiceVec.size();
}
- inline unsigned getNumChoicesInClass (const InstrSchedClass& sc) const {
+ inline unsigned getNumChoicesInClass (const InstrSchedClass& sc) const {
assert(sc < numInClass.size() && "Invalid op code or sched class!");
return numInClass[sc];
}
inline const SchedGraphNode* getChoice(unsigned int i) const {
- // assert(i < choiceVec.size()); don't check here.
+ // assert(i < choiceVec.size()); don't check here.
return choiceVec[i];
}
@@ -425,7 +425,7 @@
return choicesForSlot[slotNum];
}
- inline void addChoice (const SchedGraphNode* node) {
+ inline void addChoice (const SchedGraphNode* node) {
// Append the instruction to the vector of choices for current cycle.
// Increment numInClass[c] for the sched class to which the instr belongs.
choiceVec.push_back(node);
@@ -434,14 +434,14 @@
numInClass[sc]++;
}
- inline void addChoiceToSlot (unsigned int slotNum,
- const SchedGraphNode* node) {
+ inline void addChoiceToSlot (unsigned int slotNum,
+ const SchedGraphNode* node) {
// Add the instruction to the choice set for the specified slot
assert(slotNum < nslots);
choicesForSlot[slotNum].insert(node);
}
- inline void resetChoices () {
+ inline void resetChoices () {
choiceVec.clear();
for (unsigned int s=0; s < nslots; s++)
choicesForSlot[s].clear();
@@ -453,21 +453,21 @@
// Code to query and manage the partial instruction schedule so far
//----------------------------------------------------------------------
- inline unsigned int getNumScheduled () const {
+ inline unsigned int getNumScheduled () const {
return isched.getNumInstructions();
}
- inline unsigned int getNumUnscheduled() const {
+ inline unsigned int getNumUnscheduled() const {
return totalInstrCount - isched.getNumInstructions();
}
- inline bool isScheduled (const SchedGraphNode* node) const {
+ inline bool isScheduled (const SchedGraphNode* node) const {
return (isched.getStartTime(node->getNodeId()) >= 0);
}
- inline void scheduleInstr (const SchedGraphNode* node,
- unsigned int slotNum,
- CycleCount_t cycle)
+ inline void scheduleInstr (const SchedGraphNode* node,
+ unsigned int slotNum,
+ CycleCount_t cycle)
{
assert(! isScheduled(node) && "Instruction already scheduled?");
@@ -493,7 +493,7 @@
//----------------------------------------------------------------------
inline DelaySlotInfo* getDelaySlotInfoForInstr(const SchedGraphNode* bn,
- bool createIfMissing=false)
+ bool createIfMissing=false)
{
hash_map<const SchedGraphNode*, DelaySlotInfo*>::const_iterator
I = delaySlotInfoForBranches.find(bn);
@@ -515,8 +515,8 @@
/*ctor*/
SchedulingManager::SchedulingManager(const TargetMachine& target,
- const SchedGraph* graph,
- SchedPriorities& _schedPrio)
+ const SchedGraph* graph,
+ SchedPriorities& _schedPrio)
: nslots(target.getSchedInfo()->getMaxNumIssueTotal()),
schedInfo(*target.getSchedInfo()),
schedPrio(_schedPrio),
@@ -524,9 +524,9 @@
totalInstrCount(graph->getNumNodes() - 2),
nextEarliestIssueTime(0),
choicesForSlot(nslots),
- numInClass(target.getSchedInfo()->getNumSchedClasses(), 0), // set all to 0
+ numInClass(target.getSchedInfo()->getNumSchedClasses(), 0), // set all to 0
nextEarliestStartTime(target.getInstrInfo()->getNumOpcodes(),
- (CycleCount_t) 0) // set all to 0
+ (CycleCount_t) 0) // set all to 0
{
updateTime(0);
@@ -540,12 +540,12 @@
void
SchedulingManager::updateEarliestStartTimes(const SchedGraphNode* node,
- CycleCount_t schedTime)
+ CycleCount_t schedTime)
{
if (schedInfo.numBubblesAfter(node->getOpcode()) > 0)
{ // Update next earliest time before which *nothing* can issue.
nextEarliestIssueTime = std::max(nextEarliestIssueTime,
- curTime + 1 + schedInfo.numBubblesAfter(node->getOpcode()));
+ curTime + 1 + schedInfo.numBubblesAfter(node->getOpcode()));
}
const std::vector<MachineOpCode>&
@@ -637,10 +637,10 @@
if (!(I->getOpcode() == V9::NOP || I->getOpcode() == V9::PHI))
++numInstr;
assert(S.isched.getNumInstructions() >= numInstr &&
- "Lost some non-NOP instructions during scheduling!");
+ "Lost some non-NOP instructions during scheduling!");
if (S.isched.getNumInstructions() == 0)
- return; // empty basic block!
+ return; // empty basic block!
// First find the dummy instructions at the start of the basic block
MachineBasicBlock::iterator I = MBB.begin();
@@ -668,19 +668,19 @@
//
for (sg_succ_const_iterator SI = succ_begin(node); SI !=succ_end(node); ++SI)
if (! (*SI)->isDummyNode()
- && ! S.isScheduled(*SI)
- && ! S.schedPrio.nodeIsReady(*SI))
+ && ! S.isScheduled(*SI)
+ && ! S.schedPrio.nodeIsReady(*SI))
{
// successor not scheduled and not marked ready; check *its* preds.
-
+
bool succIsReady = true;
for (sg_pred_const_iterator P=pred_begin(*SI); P != pred_end(*SI); ++P)
if (! (*P)->isDummyNode() && ! S.isScheduled(*P)) {
succIsReady = false;
break;
}
-
- if (succIsReady) // add the successor to the ready list
+
+ if (succIsReady) // add the successor to the ready list
S.schedPrio.insertReady(*SI);
}
}
@@ -692,12 +692,12 @@
// of chosen instructions can be issued in a single group.
//
// Return value:
-// maxIssue : total number of feasible instructions
-// S.choicesForSlot[i=0..nslots] : set of instructions feasible in slot i
+// maxIssue : total number of feasible instructions
+// S.choicesForSlot[i=0..nslots] : set of instructions feasible in slot i
//
static unsigned
FindSlotChoices(SchedulingManager& S,
- DelaySlotInfo*& getDelaySlotInfo)
+ DelaySlotInfo*& getDelaySlotInfo)
{
// initialize result vectors to empty
S.resetChoices();
@@ -727,7 +727,7 @@
while (S.getNumChoices() < S.nslots - startSlot) {
const SchedGraphNode* nextNode=S.schedPrio.getNextHighest(S,S.getTime());
if (nextNode == NULL)
- break; // no more instructions for this cycle
+ break; // no more instructions for this cycle
if (S.getInstrInfo().getNumDelaySlots(nextNode->getOpcode()) > 0) {
delaySlotInfo = S.getDelaySlotInfoForInstr(nextNode);
@@ -758,12 +758,12 @@
}
if (indexForDelayedInstr < S.nslots)
- break; // leave the rest for delay slots
+ break; // leave the rest for delay slots
}
assert(S.getNumChoices() <= S.nslots);
assert(! (indexForDelayedInstr < S.nslots &&
- indexForBreakingNode < S.nslots) && "Cannot have both in a cycle");
+ indexForBreakingNode < S.nslots) && "Cannot have both in a cycle");
// Assign each chosen instruction to all possible slots for that instr.
// But if only one instruction was chosen, put it only in the first
@@ -828,7 +828,7 @@
S.addChoiceToSlot(s, S.getChoice(i));
noSlotFound = false;
}
-
+
// No slot before `delayedNodeSlot' was found for this opCode
// Use a later slot, and allow some delay slots to fall in
// the next cycle.
@@ -838,9 +838,9 @@
S.addChoiceToSlot(s, S.getChoice(i));
break;
}
-
+
assert(s < S.nslots && "No feasible slot for instruction?");
-
+
highestSlotUsed = std::max(highestSlotUsed, (int) s);
}
@@ -867,7 +867,7 @@
const SchedGraphNode* breakingNode=S.getChoice(indexForBreakingNode);
unsigned breakingSlot = INT_MAX;
unsigned int nslotsToUse = S.nslots;
-
+
// Find the last possible slot for this instruction.
for (int s = S.nslots-1; s >= (int) startSlot; s--)
if (S.schedInfo.instrCanUseSlot(breakingNode->getOpcode(), s)) {
@@ -884,24 +884,24 @@
i < S.getNumChoices() && i < indexForBreakingNode; i++)
{
MachineOpCode opCode =S.getChoice(i)->getOpcode();
-
+
// If a higher priority instruction cannot be assigned to
// any earlier slots, don't schedule the breaking instruction.
//
bool foundLowerSlot = false;
- nslotsToUse = S.nslots; // May be modified in the loop
+ nslotsToUse = S.nslots; // May be modified in the loop
for (unsigned int s=startSlot; s < nslotsToUse; s++)
if (S.schedInfo.instrCanUseSlot(opCode, s)) {
if (breakingSlot < S.nslots && s < breakingSlot) {
foundLowerSlot = true;
nslotsToUse = breakingSlot; // RESETS LOOP UPPER BOUND!
}
-
+
S.addChoiceToSlot(s, S.getChoice(i));
}
-
+
if (!foundLowerSlot)
- breakingSlot = INT_MAX; // disable breaking instr
+ breakingSlot = INT_MAX; // disable breaking instr
}
// Assign the breaking instruction (if any) to a single slot
@@ -912,7 +912,7 @@
nslotsToUse = breakingSlot;
} else
nslotsToUse = S.nslots;
-
+
// For lower priority instructions than the one that breaks the
// group, only assign them to slots lower than the breaking slot.
// Otherwise, just ignore the instruction.
@@ -932,7 +932,7 @@
ChooseOneGroup(SchedulingManager& S)
{
assert(S.schedPrio.getNumReady() > 0
- && "Don't get here without ready instructions.");
+ && "Don't get here without ready instructions.");
CycleCount_t firstCycle = S.getTime();
DelaySlotInfo* getDelaySlotInfo = NULL;
@@ -1022,9 +1022,9 @@
static bool
NodeCanFillDelaySlot(const SchedulingManager& S,
- const SchedGraphNode* node,
- const SchedGraphNode* brNode,
- bool nodeIsPredecessor)
+ const SchedGraphNode* node,
+ const SchedGraphNode* brNode,
+ bool nodeIsPredecessor)
{
assert(! node->isDummyNode());
@@ -1042,8 +1042,8 @@
for (SchedGraphNode::const_iterator EI = node->beginInEdges();
EI != node->endInEdges(); ++EI)
if (! ((SchedGraphNode*)(*EI)->getSrc())->isDummyNode()
- && mii.isLoad(((SchedGraphNode*)(*EI)->getSrc())->getOpcode())
- && (*EI)->getDepType() == SchedGraphEdge::CtrlDep)
+ && mii.isLoad(((SchedGraphNode*)(*EI)->getSrc())->getOpcode())
+ && (*EI)->getDepType() == SchedGraphEdge::CtrlDep)
return false;
// Finally, if the instruction precedes the branch, we make sure the
@@ -1072,10 +1072,10 @@
static void
MarkNodeForDelaySlot(SchedulingManager& S,
- SchedGraph* graph,
- SchedGraphNode* node,
- const SchedGraphNode* brNode,
- bool nodeIsPredecessor)
+ SchedGraph* graph,
+ SchedGraphNode* node,
+ const SchedGraphNode* brNode,
+ bool nodeIsPredecessor)
{
if (nodeIsPredecessor) {
// If node is in the same basic block (i.e., precedes brNode),
@@ -1115,8 +1115,8 @@
for (sg_pred_iterator P = pred_begin(brNode);
P != pred_end(brNode) && sdelayNodeVec.size() < ndelays; ++P)
if (! (*P)->isDummyNode() &&
- ! mii.isNop((*P)->getOpcode()) &&
- NodeCanFillDelaySlot(S, *P, brNode, /*pred*/ true))
+ ! mii.isNop((*P)->getOpcode()) &&
+ NodeCanFillDelaySlot(S, *P, brNode, /*pred*/ true))
{
if (mii.maxLatency((*P)->getOpcode()) > 1)
mdelayNodeVec.push_back(*P);
@@ -1198,7 +1198,7 @@
sdelayNodeVec.push_back(graph->getGraphNodeForInstr(MBBI));
else {
nopNodeVec.push_back(graph->getGraphNodeForInstr(MBBI));
-
+
//remove the MI from the Machine Code For Instruction
const TerminatorInst *TI = MBB.getBasicBlock()->getTerminator();
MachineCodeForInstruction& llvmMvec =
@@ -1241,7 +1241,7 @@
//
static void
ChooseInstructionsForDelaySlots(SchedulingManager& S, MachineBasicBlock &MBB,
- SchedGraph *graph)
+ SchedGraph *graph)
{
const TargetInstrInfo& mii = S.getInstrInfo();
@@ -1301,7 +1301,7 @@
{
assert(delayedNodeSlotNum < S.nslots && "Illegal slot for branch");
assert(S.isched.getInstr(delayedNodeSlotNum, delayedNodeCycle) == NULL
- && "Slot for branch should be empty");
+ && "Slot for branch should be empty");
unsigned int nextSlot = delayedNodeSlotNum;
CycleCount_t nextTime = delayedNodeCycle;
@@ -1350,7 +1350,7 @@
nextTime++;
}
} while (S.isched.getInstr(nextSlot, nextTime) != NULL);
-
+
S.scheduleInstr(delayNodeVec[i], nextSlot, nextTime);
break;
}
@@ -1364,7 +1364,7 @@
//
static inline bool
ConflictsWithChoices(const SchedulingManager& S,
- MachineOpCode opCode)
+ MachineOpCode opCode)
{
// Check if the instruction must issue by itself, and some feasible
// choices have already been made for this cycle
@@ -1394,8 +1394,8 @@
static inline bool
ViolatesMinimumGap(const SchedulingManager& S,
- MachineOpCode opCode,
- const CycleCount_t inCycle)
+ MachineOpCode opCode,
+ const CycleCount_t inCycle)
{
return (inCycle < S.getEarliestStartTimeForOp(opCode));
}
@@ -1411,7 +1411,7 @@
bool
instrIsFeasible(const SchedulingManager& S,
- MachineOpCode opCode)
+ MachineOpCode opCode)
{
// skip the instruction if it cannot be issued due to issue restrictions
// caused by previously issued instructions
@@ -1457,7 +1457,7 @@
bool InstructionSchedulingWithSSA::runOnFunction(Function &F)
{
- SchedGraphSet graphSet(&F, target);
+ SchedGraphSet graphSet(&F, target);
if (SchedDebugLevel >= Sched_PrintSchedGraphs) {
std::cerr << "\n*** SCHEDULING GRAPHS FOR INSTRUCTION SCHEDULING\n";
Index: llvm/lib/Target/SparcV9/InstrSched/SchedGraph.cpp
diff -u llvm/lib/Target/SparcV9/InstrSched/SchedGraph.cpp:1.69 llvm/lib/Target/SparcV9/InstrSched/SchedGraph.cpp:1.70
--- llvm/lib/Target/SparcV9/InstrSched/SchedGraph.cpp:1.69 Thu Apr 21 18:27:12 2005
+++ llvm/lib/Target/SparcV9/InstrSched/SchedGraph.cpp Wed Jul 27 00:53:43 2005
@@ -72,12 +72,12 @@
// Method: SchedGraphNode Destructor
//
// Description:
-// Free memory allocated by the SchedGraphNode object.
+// Free memory allocated by the SchedGraphNode object.
//
// Notes:
-// Do not delete the edges here. The base class will take care of that.
-// Only handle subclass specific stuff here (where currently there is
-// none).
+// Do not delete the edges here. The base class will take care of that.
+// Only handle subclass specific stuff here (where currently there is
+// none).
//
SchedGraphNode::~SchedGraphNode() {
}
@@ -94,11 +94,11 @@
// Method: SchedGraph Destructor
//
// Description:
-// This method deletes memory allocated by the SchedGraph object.
+// This method deletes memory allocated by the SchedGraph object.
//
// Notes:
-// Do not delete the graphRoot or graphLeaf here. The base class handles
-// that bit of work.
+// Do not delete the graphRoot or graphLeaf here. The base class handles
+// that bit of work.
//
SchedGraph::~SchedGraph() {
for (const_iterator I = begin(); I != end(); ++I)
@@ -139,7 +139,7 @@
void SchedGraph::addCDEdges(const TerminatorInst* term,
- const TargetMachine& target) {
+ const TargetMachine& target) {
const TargetInstrInfo& mii = *target.getInstrInfo();
MachineCodeForInstruction &termMvec = MachineCodeForInstruction::get(term);
@@ -150,7 +150,7 @@
! mii.isReturn(termMvec[first]->getOpcode()))
++first;
assert(first < termMvec.size() &&
- "No branch instructions for terminator? Ok, but weird!");
+ "No branch instructions for terminator? Ok, but weird!");
if (first == termMvec.size())
return;
@@ -171,7 +171,7 @@
assert(brNode && "No node for instr generated for branch/ret?");
(void) new SchedGraphEdge(brNode, toNode, SchedGraphEdge::CtrlDep,
SchedGraphEdge::NonDataDep, 0);
- break; // only one incoming edge is enough
+ break; // only one incoming edge is enough
}
}
@@ -194,7 +194,7 @@
SchedGraphNode* fromNode = getGraphNodeForInstr(I);
if (fromNode == NULL)
- continue; // dummy instruction, e.g., PHI
+ continue; // dummy instruction, e.g., PHI
(void) new SchedGraphEdge(fromNode, firstBrNode,
SchedGraphEdge::CtrlDep,
@@ -241,7 +241,7 @@
// latency does not otherwise matter (true dependences enforce that).
//
void SchedGraph::addMemEdges(const std::vector<SchedGraphNode*>& memNodeVec,
- const TargetMachine& target) {
+ const TargetMachine& target) {
const TargetInstrInfo& mii = *target.getInstrInfo();
// Instructions in memNodeVec are in execution order within the basic block,
@@ -273,7 +273,7 @@
// like with control dependences.
//
void SchedGraph::addCallDepEdges(const std::vector<SchedGraphNode*>& callDepNodeVec,
- const TargetMachine& target) {
+ const TargetMachine& target) {
const TargetInstrInfo& mii = *target.getInstrInfo();
// Instructions in memNodeVec are in execution order within the basic block,
@@ -283,15 +283,15 @@
if (mii.isCall(callDepNodeVec[ic]->getOpcode())) {
// Add SG_CALL_REF edges from all preds to this instruction.
for (unsigned jc=0; jc < ic; jc++)
- (void) new SchedGraphEdge(callDepNodeVec[jc], callDepNodeVec[ic],
- SchedGraphEdge::MachineRegister,
- MachineIntRegsRID, 0);
+ (void) new SchedGraphEdge(callDepNodeVec[jc], callDepNodeVec[ic],
+ SchedGraphEdge::MachineRegister,
+ MachineIntRegsRID, 0);
// And do the same from this instruction to all successors.
for (unsigned jc=ic+1; jc < NC; jc++)
- (void) new SchedGraphEdge(callDepNodeVec[ic], callDepNodeVec[jc],
- SchedGraphEdge::MachineRegister,
- MachineIntRegsRID, 0);
+ (void) new SchedGraphEdge(callDepNodeVec[ic], callDepNodeVec[jc],
+ SchedGraphEdge::MachineRegister,
+ MachineIntRegsRID, 0);
}
#ifdef CALL_DEP_NODE_VEC_CANNOT_WORK
@@ -331,7 +331,7 @@
void SchedGraph::addMachineRegEdges(RegToRefVecMap& regToRefVecMap,
- const TargetMachine& target) {
+ const TargetMachine& target) {
// This code assumes that two registers with different numbers are
// not aliased!
//
@@ -365,7 +365,7 @@
new SchedGraphEdge(prevNode, node, regNum,
SchedGraphEdge::AntiDep);
}
-
+
if (prevIsDef)
if (!isDef || isDefAndUse)
new SchedGraphEdge(prevNode, node, regNum,
@@ -382,11 +382,11 @@
// We do not consider other uses because we are not building use-use deps.
//
void SchedGraph::addEdgesForValue(SchedGraphNode* refNode,
- const RefVec& defVec,
- const Value* defValue,
- bool refNodeIsDef,
- bool refNodeIsUse,
- const TargetMachine& target) {
+ const RefVec& defVec,
+ const Value* defValue,
+ bool refNodeIsDef,
+ bool refNodeIsUse,
+ const TargetMachine& target) {
// Add true or output dep edges from all def nodes before refNode in BB.
// Add anti or output dep edges to all def nodes after refNode.
for (RefVec::const_iterator I=defVec.begin(), E=defVec.end(); I != E; ++I) {
@@ -415,8 +415,8 @@
void SchedGraph::addEdgesForInstruction(const MachineInstr& MI,
- const ValueToDefVecMap& valueToDefVecMap,
- const TargetMachine& target) {
+ const ValueToDefVecMap& valueToDefVecMap,
+ const TargetMachine& target) {
SchedGraphNode* node = getGraphNodeForInstr(&MI);
if (node == NULL)
return;
@@ -443,7 +443,7 @@
case MachineOperand::MO_UnextendedImmed:
case MachineOperand::MO_PCRelativeDisp:
case MachineOperand::MO_ConstantPoolIndex:
- break; // nothing to do for immediate fields
+ break; // nothing to do for immediate fields
default:
assert(0 && "Unknown machine operand type in SchedGraph builder");
@@ -468,11 +468,11 @@
void SchedGraph::findDefUseInfoAtInstr(const TargetMachine& target,
- SchedGraphNode* node,
- std::vector<SchedGraphNode*>& memNodeVec,
- std::vector<SchedGraphNode*>& callDepNodeVec,
- RegToRefVecMap& regToRefVecMap,
- ValueToDefVecMap& valueToDefVecMap) {
+ SchedGraphNode* node,
+ std::vector<SchedGraphNode*>& memNodeVec,
+ std::vector<SchedGraphNode*>& callDepNodeVec,
+ RegToRefVecMap& regToRefVecMap,
+ ValueToDefVecMap& valueToDefVecMap) {
const TargetInstrInfo& mii = *target.getInstrInfo();
MachineOpCode opCode = node->getOpcode();
@@ -550,11 +550,11 @@
void SchedGraph::buildNodesForBB(const TargetMachine& target,
- MachineBasicBlock& MBB,
- std::vector<SchedGraphNode*>& memNodeVec,
- std::vector<SchedGraphNode*>& callDepNodeVec,
- RegToRefVecMap& regToRefVecMap,
- ValueToDefVecMap& valueToDefVecMap) {
+ MachineBasicBlock& MBB,
+ std::vector<SchedGraphNode*>& memNodeVec,
+ std::vector<SchedGraphNode*>& callDepNodeVec,
+ RegToRefVecMap& regToRefVecMap,
+ ValueToDefVecMap& valueToDefVecMap) {
const TargetInstrInfo& mii = *target.getInstrInfo();
// Build graph nodes for each VM instruction and gather def/use info.
@@ -646,7 +646,7 @@
this->addMachineRegEdges(regToRefVecMap, target);
// Finally, add edges from the dummy root and to dummy leaf
- this->addDummyEdges();
+ this->addDummyEdges();
}
@@ -654,7 +654,7 @@
// class SchedGraphSet
//
SchedGraphSet::SchedGraphSet(const Function* _function,
- const TargetMachine& target) :
+ const TargetMachine& target) :
function(_function) {
buildGraphsForMethod(function, target);
}
@@ -679,7 +679,7 @@
void SchedGraphSet::buildGraphsForMethod(const Function *F,
- const TargetMachine& target) {
+ const TargetMachine& target) {
MachineFunction &MF = MachineFunction::get(F);
for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
addGraph(new SchedGraph(*I, target));
@@ -691,13 +691,13 @@
<< sink->getNodeId() << "] : ";
switch(depType) {
- case SchedGraphEdge::CtrlDep:
+ case SchedGraphEdge::CtrlDep:
os<< "Control Dep";
break;
case SchedGraphEdge::ValueDep:
os<< "Reg Value " << *val;
break;
- case SchedGraphEdge::MemoryDep:
+ case SchedGraphEdge::MemoryDep:
os<< "Memory Dep";
break;
case SchedGraphEdge::MachineRegister:
Index: llvm/lib/Target/SparcV9/InstrSched/SchedGraph.h
diff -u llvm/lib/Target/SparcV9/InstrSched/SchedGraph.h:1.41 llvm/lib/Target/SparcV9/InstrSched/SchedGraph.h:1.42
--- llvm/lib/Target/SparcV9/InstrSched/SchedGraph.h:1.41 Thu Apr 21 18:27:12 2005
+++ llvm/lib/Target/SparcV9/InstrSched/SchedGraph.h Wed Jul 27 00:53:43 2005
@@ -38,11 +38,11 @@
SchedGraphNode(unsigned nodeId, MachineBasicBlock *mbb, int indexInBB,
- const TargetMachine& Target);
+ const TargetMachine& Target);
~SchedGraphNode();
- friend class SchedGraph; // give access for ctor and dtor
- friend class SchedGraphEdge; // give access for adding edges
+ friend class SchedGraph; // give access for ctor and dtor
+ friend class SchedGraphEdge; // give access for adding edges
public:
@@ -95,10 +95,10 @@
}
private:
- friend class SchedGraphSet; // give access to ctor
+ friend class SchedGraphSet; // give access to ctor
- inline void noteGraphNodeForInstr (const MachineInstr* minstr,
- SchedGraphNode* node) {
+ inline void noteGraphNodeForInstr (const MachineInstr* minstr,
+ SchedGraphNode* node) {
assert((*this)[minstr] == NULL);
(*this)[minstr] = node;
}
@@ -109,41 +109,41 @@
void buildGraph(const TargetMachine& target);
void buildNodesForBB(const TargetMachine& target,MachineBasicBlock &MBB,
- std::vector<SchedGraphNode*>& memNV,
- std::vector<SchedGraphNode*>& callNV,
- RegToRefVecMap& regToRefVecMap,
- ValueToDefVecMap& valueToDefVecMap);
+ std::vector<SchedGraphNode*>& memNV,
+ std::vector<SchedGraphNode*>& callNV,
+ RegToRefVecMap& regToRefVecMap,
+ ValueToDefVecMap& valueToDefVecMap);
void findDefUseInfoAtInstr(const TargetMachine& target, SchedGraphNode* node,
- std::vector<SchedGraphNode*>& memNV,
- std::vector<SchedGraphNode*>& callNV,
- RegToRefVecMap& regToRefVecMap,
- ValueToDefVecMap& valueToDefVecMap);
+ std::vector<SchedGraphNode*>& memNV,
+ std::vector<SchedGraphNode*>& callNV,
+ RegToRefVecMap& regToRefVecMap,
+ ValueToDefVecMap& valueToDefVecMap);
void addEdgesForInstruction(const MachineInstr& minstr,
- const ValueToDefVecMap& valueToDefVecMap,
- const TargetMachine& target);
+ const ValueToDefVecMap& valueToDefVecMap,
+ const TargetMachine& target);
void addCDEdges(const TerminatorInst* term, const TargetMachine& target);
void addMemEdges(const std::vector<SchedGraphNode*>& memNod,
- const TargetMachine& target);
+ const TargetMachine& target);
void addCallCCEdges(const std::vector<SchedGraphNode*>& memNod,
- MachineBasicBlock& bbMvec,
- const TargetMachine& target);
+ MachineBasicBlock& bbMvec,
+ const TargetMachine& target);
void addCallDepEdges(const std::vector<SchedGraphNode*>& callNV,
- const TargetMachine& target);
+ const TargetMachine& target);
void addMachineRegEdges(RegToRefVecMap& regToRefVecMap,
- const TargetMachine& target);
+ const TargetMachine& target);
void addEdgesForValue(SchedGraphNode* refNode, const RefVec& defVec,
- const Value* defValue, bool refNodeIsDef,
- bool refNodeIsDefAndUse,
- const TargetMachine& target);
+ const Value* defValue, bool refNodeIsDef,
+ bool refNodeIsDefAndUse,
+ const TargetMachine& target);
void addDummyEdges();
Index: llvm/lib/Target/SparcV9/InstrSched/SchedGraphCommon.cpp
diff -u llvm/lib/Target/SparcV9/InstrSched/SchedGraphCommon.cpp:1.9 llvm/lib/Target/SparcV9/InstrSched/SchedGraphCommon.cpp:1.10
--- llvm/lib/Target/SparcV9/InstrSched/SchedGraphCommon.cpp:1.9 Thu Apr 21 18:27:12 2005
+++ llvm/lib/Target/SparcV9/InstrSched/SchedGraphCommon.cpp Wed Jul 27 00:53:43 2005
@@ -25,10 +25,10 @@
// class SchedGraphEdge
//
SchedGraphEdge::SchedGraphEdge(SchedGraphNodeCommon* _src,
- SchedGraphNodeCommon* _sink,
- SchedGraphEdgeDepType _depType,
- unsigned int _depOrderType,
- int _minDelay)
+ SchedGraphNodeCommon* _sink,
+ SchedGraphEdgeDepType _depType,
+ unsigned int _depOrderType,
+ int _minDelay)
: src(_src), sink(_sink), depType(_depType), depOrderType(_depOrderType),
minDelay((_minDelay >= 0)? _minDelay : _src->getLatency()), val(NULL) {
@@ -39,10 +39,10 @@
}
SchedGraphEdge::SchedGraphEdge(SchedGraphNodeCommon* _src,
- SchedGraphNodeCommon* _sink,
- const Value* _val,
- unsigned int _depOrderType,
- int _minDelay)
+ SchedGraphNodeCommon* _sink,
+ const Value* _val,
+ unsigned int _depOrderType,
+ int _minDelay)
: src(_src), sink(_sink), depType(ValueDep), depOrderType(_depOrderType),
minDelay((_minDelay >= 0)? _minDelay : _src->getLatency()), val(_val) {
iteDiff=0;
@@ -52,10 +52,10 @@
}
SchedGraphEdge::SchedGraphEdge(SchedGraphNodeCommon* _src,
- SchedGraphNodeCommon* _sink,
- unsigned int _regNum,
- unsigned int _depOrderType,
- int _minDelay)
+ SchedGraphNodeCommon* _sink,
+ unsigned int _regNum,
+ unsigned int _depOrderType,
+ int _minDelay)
: src(_src), sink(_sink), depType(MachineRegister),
depOrderType(_depOrderType),
minDelay((_minDelay >= 0)? _minDelay : _src->getLatency()),
@@ -67,9 +67,9 @@
}
SchedGraphEdge::SchedGraphEdge(SchedGraphNodeCommon* _src,
- SchedGraphNodeCommon* _sink,
- ResourceId _resourceId,
- int _minDelay)
+ SchedGraphNodeCommon* _sink,
+ ResourceId _resourceId,
+ int _minDelay)
: src(_src), sink(_sink), depType(MachineResource), depOrderType(NonDataDep),
minDelay((_minDelay >= 0)? _minDelay : _src->getLatency()),
resourceId(_resourceId) {
@@ -125,7 +125,7 @@
void SchedGraphCommon::eraseIncomingEdges(SchedGraphNodeCommon* node,
- bool addDummyEdges) {
+ bool addDummyEdges) {
// Delete and disconnect all in-edges for the node
for (SchedGraphNodeCommon::iterator I = node->beginInEdges();
I != node->endInEdges(); ++I) {
@@ -134,13 +134,13 @@
delete *I;
if (addDummyEdges && srcNode != getRoot() &&
- srcNode->beginOutEdges() == srcNode->endOutEdges()) {
+ srcNode->beginOutEdges() == srcNode->endOutEdges()) {
// srcNode has no more out edges, so add an edge to dummy EXIT node
assert(node != getLeaf() && "Adding edge that was just removed?");
(void) new SchedGraphEdge(srcNode, getLeaf(),
- SchedGraphEdge::CtrlDep,
- SchedGraphEdge::NonDataDep, 0);
+ SchedGraphEdge::CtrlDep,
+ SchedGraphEdge::NonDataDep, 0);
}
}
@@ -148,7 +148,7 @@
}
void SchedGraphCommon::eraseOutgoingEdges(SchedGraphNodeCommon* node,
- bool addDummyEdges) {
+ bool addDummyEdges) {
// Delete and disconnect all out-edges for the node
for (SchedGraphNodeCommon::iterator I = node->beginOutEdges();
I != node->endOutEdges(); ++I) {
@@ -157,14 +157,14 @@
delete *I;
if (addDummyEdges &&
- sinkNode != getLeaf() &&
- sinkNode->beginInEdges() == sinkNode->endInEdges()) {
+ sinkNode != getLeaf() &&
+ sinkNode->beginInEdges() == sinkNode->endInEdges()) {
//sinkNode has no more in edges, so add an edge from dummy ENTRY node
assert(node != getRoot() && "Adding edge that was just removed?");
(void) new SchedGraphEdge(getRoot(), sinkNode,
- SchedGraphEdge::CtrlDep,
- SchedGraphEdge::NonDataDep, 0);
+ SchedGraphEdge::CtrlDep,
+ SchedGraphEdge::NonDataDep, 0);
}
}
@@ -172,9 +172,9 @@
}
void SchedGraphCommon::eraseIncidentEdges(SchedGraphNodeCommon* node,
- bool addDummyEdges) {
- this->eraseIncomingEdges(node, addDummyEdges);
- this->eraseOutgoingEdges(node, addDummyEdges);
+ bool addDummyEdges) {
+ this->eraseIncomingEdges(node, addDummyEdges);
+ this->eraseOutgoingEdges(node, addDummyEdges);
}
} // End llvm namespace
Index: llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp
diff -u llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp:1.37 llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp:1.38
--- llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp:1.37 Thu Apr 21 18:27:12 2005
+++ llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp Wed Jul 27 00:53:43 2005
@@ -28,7 +28,7 @@
std::ostream &operator<<(std::ostream &os, const NodeDelayPair* nd) {
return os << "Delay for node " << nd->node->getNodeId()
- << " = " << (long)nd->delay << "\n";
+ << " = " << (long)nd->delay << "\n";
}
@@ -118,7 +118,7 @@
void
SchedPriorities::issuedReadyNodeAt(CycleCount_t curTime,
- const SchedGraphNode* node) {
+ const SchedGraphNode* node) {
candsAsHeap.removeNode(node);
candsAsSet.erase(node);
mcands.clear(); // ensure reset choices is called before any more choices
@@ -156,8 +156,8 @@
inline int
SchedPriorities::chooseByRule1(std::vector<candIndex>& mcands) {
- return (mcands.size() == 1)? 0 // only one choice exists so take it
- : -1; // -1 indicates multiple choices
+ return (mcands.size() == 1)? 0 // only one choice exists so take it
+ : -1; // -1 indicates multiple choices
}
inline int
@@ -165,7 +165,7 @@
assert(mcands.size() >= 1 && "Should have at least one candidate here.");
for (unsigned i=0, N = mcands.size(); i < N; i++)
if (instructionHasLastUse(methodLiveVarInfo,
- candsAsHeap.getNode(mcands[i])))
+ candsAsHeap.getNode(mcands[i])))
return i;
return -1;
}
@@ -173,7 +173,7 @@
inline int
SchedPriorities::chooseByRule3(std::vector<candIndex>& mcands) {
assert(mcands.size() >= 1 && "Should have at least one candidate here.");
- int maxUses = candsAsHeap.getNode(mcands[0])->getNumOutEdges();
+ int maxUses = candsAsHeap.getNode(mcands[0])->getNumOutEdges();
int indexWithMaxUses = 0;
for (unsigned i=1, N = mcands.size(); i < N; i++) {
int numUses = candsAsHeap.getNode(mcands[i])->getNumOutEdges();
@@ -187,7 +187,7 @@
const SchedGraphNode*
SchedPriorities::getNextHighest(const SchedulingManager& S,
- CycleCount_t curTime) {
+ CycleCount_t curTime) {
int nextIdx = -1;
const SchedGraphNode* nextChoice = NULL;
@@ -195,7 +195,7 @@
findSetWithMaxDelay(mcands, S);
while (nextIdx < 0 && mcands.size() > 0) {
- nextIdx = chooseByRule1(mcands); // rule 1
+ nextIdx = chooseByRule1(mcands); // rule 1
if (nextIdx == -1)
nextIdx = chooseByRule2(mcands); // rule 2
@@ -204,7 +204,7 @@
nextIdx = chooseByRule3(mcands); // rule 3
if (nextIdx == -1)
- nextIdx = 0; // default to first choice by delays
+ nextIdx = 0; // default to first choice by delays
// We have found the next best candidate. Check if it ready in
// the current cycle, and if it is feasible.
@@ -231,7 +231,7 @@
void
SchedPriorities::findSetWithMaxDelay(std::vector<candIndex>& mcands,
- const SchedulingManager& S)
+ const SchedulingManager& S)
{
if (mcands.size() == 0 && nextToTry != candsAsHeap.end())
{ // out of choices at current maximum delay;
@@ -239,8 +239,8 @@
candIndex next = nextToTry;
CycleCount_t maxDelay = candsAsHeap.getDelay(next);
for (; next != candsAsHeap.end()
- && candsAsHeap.getDelay(next) == maxDelay; ++next)
- mcands.push_back(next);
+ && candsAsHeap.getDelay(next) == maxDelay; ++next)
+ mcands.push_back(next);
nextToTry = next;
@@ -258,7 +258,7 @@
bool
SchedPriorities::instructionHasLastUse(FunctionLiveVarInfo &LVI,
- const SchedGraphNode* graphNode) {
+ const SchedGraphNode* graphNode) {
const MachineInstr *MI = graphNode->getMachineInstr();
hash_map<const MachineInstr*, bool>::const_iterator
Index: llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.h
diff -u llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.h:1.29 llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.h:1.30
--- llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.h:1.29 Thu Apr 21 18:27:12 2005
+++ llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.h Wed Jul 27 00:53:43 2005
@@ -84,40 +84,40 @@
inline unsigned size() const { return _size; }
- const SchedGraphNode* getNode (const_iterator i) const { return (*i)->node; }
- CycleCount_t getDelay(const_iterator i) const { return (*i)->delay;}
+ const SchedGraphNode* getNode (const_iterator i) const { return (*i)->node; }
+ CycleCount_t getDelay(const_iterator i) const { return (*i)->delay;}
- inline void makeHeap() {
+ inline void makeHeap() {
// make_heap(begin(), end(), NDPLessThan);
}
- inline iterator findNode(const SchedGraphNode* node) {
+ inline iterator findNode(const SchedGraphNode* node) {
for (iterator I=begin(); I != end(); ++I)
if (getNode(I) == node)
- return I;
+ return I;
return end();
}
- inline void removeNode (const SchedGraphNode* node) {
+ inline void removeNode (const SchedGraphNode* node) {
iterator ndpPtr = findNode(node);
if (ndpPtr != end())
{
- delete *ndpPtr;
- erase(ndpPtr);
- --_size;
+ delete *ndpPtr;
+ erase(ndpPtr);
+ --_size;
}
};
- void insert(const SchedGraphNode* node, CycleCount_t delay) {
+ void insert(const SchedGraphNode* node, CycleCount_t delay) {
NodeDelayPair* ndp = new NodeDelayPair(node, delay);
if (_size == 0 || front()->delay < delay)
push_front(ndp);
else
{
- iterator I=begin();
- for ( ; I != end() && getDelay(I) >= delay; ++I)
- ;
- std::list<NodeDelayPair*>::insert(I, ndp);
+ iterator I=begin();
+ for ( ; I != end() && getDelay(I) >= delay; ++I)
+ ;
+ std::list<NodeDelayPair*>::insert(I, ndp);
}
_size++;
}
@@ -135,25 +135,25 @@
// This must be called before scheduling begins.
- void initialize ();
+ void initialize ();
- CycleCount_t getTime () const { return curTime; }
- CycleCount_t getEarliestReadyTime () const { return earliestReadyTime; }
- unsigned getNumReady () const { return candsAsHeap.size(); }
- bool nodeIsReady (const SchedGraphNode* node) const {
+ CycleCount_t getTime () const { return curTime; }
+ CycleCount_t getEarliestReadyTime () const { return earliestReadyTime; }
+ unsigned getNumReady () const { return candsAsHeap.size(); }
+ bool nodeIsReady (const SchedGraphNode* node) const {
return (candsAsSet.find(node) != candsAsSet.end());
}
- void issuedReadyNodeAt (CycleCount_t curTime,
- const SchedGraphNode* node);
+ void issuedReadyNodeAt (CycleCount_t curTime,
+ const SchedGraphNode* node);
- void insertReady (const SchedGraphNode* node);
+ void insertReady (const SchedGraphNode* node);
- void updateTime (CycleCount_t /*unused*/);
+ void updateTime (CycleCount_t /*unused*/);
- const SchedGraphNode* getNextHighest (const SchedulingManager& S,
- CycleCount_t curTime);
- // choose next highest priority instr
+ const SchedGraphNode* getNextHighest (const SchedulingManager& S,
+ CycleCount_t curTime);
+ // choose next highest priority instr
private:
typedef NodeHeap::iterator candIndex;
@@ -167,30 +167,30 @@
std::vector<CycleCount_t> nodeEarliestUseVec;
std::vector<CycleCount_t> earliestReadyTimeForNode;
CycleCount_t earliestReadyTime;
- NodeHeap candsAsHeap; // candidate nodes, ready to go
+ NodeHeap candsAsHeap; // candidate nodes, ready to go
hash_set<const SchedGraphNode*> candsAsSet; //same entries as candsAsHeap,
- // but as set for fast lookup
+ // but as set for fast lookup
std::vector<candIndex> mcands; // holds pointers into cands
- candIndex nextToTry; // next cand after the last
- // one tried in this cycle
+ candIndex nextToTry; // next cand after the last
+ // one tried in this cycle
- int chooseByRule1 (std::vector<candIndex>& mcands);
- int chooseByRule2 (std::vector<candIndex>& mcands);
- int chooseByRule3 (std::vector<candIndex>& mcands);
+ int chooseByRule1 (std::vector<candIndex>& mcands);
+ int chooseByRule2 (std::vector<candIndex>& mcands);
+ int chooseByRule3 (std::vector<candIndex>& mcands);
- void findSetWithMaxDelay (std::vector<candIndex>& mcands,
- const SchedulingManager& S);
+ void findSetWithMaxDelay (std::vector<candIndex>& mcands,
+ const SchedulingManager& S);
- void computeDelays (const SchedGraph* graph);
+ void computeDelays (const SchedGraph* graph);
- void initializeReadyHeap (const SchedGraph* graph);
+ void initializeReadyHeap (const SchedGraph* graph);
- bool instructionHasLastUse (FunctionLiveVarInfo& LVI,
- const SchedGraphNode* graphNode);
+ bool instructionHasLastUse (FunctionLiveVarInfo& LVI,
+ const SchedGraphNode* graphNode);
// NOTE: The next two return references to the actual vector entries.
// Use the following two if you don't need to modify the value.
- CycleCount_t& getNodeDelayRef (const SchedGraphNode* node) {
+ CycleCount_t& getNodeDelayRef (const SchedGraphNode* node) {
assert(node->getNodeId() < nodeDelayVec.size());
return nodeDelayVec[node->getNodeId()];
}
More information about the llvm-commits
mailing list