Changes:
- $Id: schedule.c 1965 2005-02-24 19:52:00Z twisti $
+ $Id: schedule.c 1966 2005-02-24 23:39:12Z twisti $
*/
tmpmi->opdep[0] = NULL;
tmpmi->opdep[1] = NULL;
tmpmi->opdep[2] = NULL;
- tmpmi->issinknode = true; /* initially all nodes are sink nodes */
tmpmi->next = mi; /* link to next instruction */
if (mi->opdep[i]) {
if (mi->opdep[i]->priority > pathpriority)
pathpriority = mi->opdep[i]->priority;
-
- /* dependent node is non-sink node */
-
- mi->opdep[i]->issinknode = false;
}
}
void schedule_do_schedule(minstruction *mi)
{
minstruction *rootmi;
- sinknode *rootsn;
- sinknode *sn;
- s4 i;
- s4 icount; /* number of basic block instruction */
/* initialize variables */
rootmi = mi;
- rootsn = NULL;
- icount = 0;
-
- /* find all sink nodes */
-
- while (mi) {
- icount++;
-
- /* if current node is a sink node, add it to the sink node list */
-
- if (mi->issinknode) {
- sn = DNEW(sinknode);
- sn->mi = mi;
- sn->next = rootsn;
- rootsn = sn;
- }
-
- mi = mi->next;
- }
-
-
- /* walk through the instructions and do the actual scheduling */
-
- for (i = 0; i < icount; i++) {
- sn = rootsn;
-
- /* first, find the highest priority path */
-
- while (sn)
- sn = sn->next;
- }
-
printf("bb start ---\n");
/* disassinstr(&tmpmi->instr); */
printf("%05x", mi->instr);
- printf(" --> %d, %d, %d: op1=%p, op2=%p, op3=%p\n", mi->issinknode, mi->latency, mi->priority, mi->opdep[0], mi->opdep[1], mi->opdep[2]);
+ printf(" --> %d, %d: op1=%p, op2=%p, op3=%p\n", mi->latency, mi->priority, mi->opdep[0], mi->opdep[1], mi->opdep[2]);
mi = mi->next;
}
}
-minstruction *schedule_append_minstruction(minstruction *mi)
-{
- minstruction *tmpmi;
-
- /* add new instruction to the list */
-
- tmpmi = DNEW(minstruction);
- tmpmi->opdep[0] = NULL;
- tmpmi->opdep[1] = NULL;
- tmpmi->opdep[2] = NULL;
- tmpmi->next = NULL;
- mi->next = tmpmi;
-
- return tmpmi;
-}
-
-
/*
* These are local overrides for various environment variables in Emacs.
* Please do not remove this and leave it at the end of the file, where
Changes:
- $Id: schedule.h 1965 2005-02-24 19:52:00Z twisti $
+ $Id: schedule.h 1966 2005-02-24 23:39:12Z twisti $
*/
typedef struct scheduledata scheduledata;
typedef struct minstruction minstruction;
-typedef struct sinknode sinknode;
+typedef struct linknode linknode;
/* scheduledata ****************************************************************
void schedule_calc_priority(minstruction *mi);
void schedule_do_schedule(minstruction *mi);
minstruction *schedule_prepend_minstruction(minstruction *mi);
-minstruction *schedule_append_minstruction(minstruction *mi);
#endif /* _SCHEDULE_H */