summaryrefslogtreecommitdiffhomepage
path: root/ir/be/belistsched.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2009-11-06 13:51:30 +0100
committerMatthias Braun <matze@braunis.de>2009-11-06 13:51:30 +0100
commit09eee9b1bd1d75f696272f2fe37385c5f50f309d (patch)
treeaeb905a566c18ebc67a6fc01933c9636f1e85161 /ir/be/belistsched.c
parenta96b763edbb59f91b6250f651a2b4eb85e0c8e80 (diff)
more robust detection of start nodes in listsched; add debug info to be_Start node constructor
[r26720]
Diffstat (limited to 'ir/be/belistsched.c')
-rw-r--r--ir/be/belistsched.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/ir/be/belistsched.c b/ir/be/belistsched.c
index e89b31d..38f04a4 100644
--- a/ir/be/belistsched.c
+++ b/ir/be/belistsched.c
@@ -282,7 +282,8 @@ static void make_users_ready(block_sched_env_t *env, ir_node *irn)
/**
* Returns the number of not yet schedules users.
*/
-static inline int get_irn_not_sched_user(block_sched_env_t *env, ir_node *n) {
+static inline int get_irn_not_sched_user(block_sched_env_t *env, ir_node *n)
+{
int idx = get_irn_idx(n);
assert(idx < ARR_LEN(env->sched_info));
@@ -292,7 +293,8 @@ static inline int get_irn_not_sched_user(block_sched_env_t *env, ir_node *n) {
/**
* Sets the number of not yet schedules users.
*/
-static inline void set_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int num) {
+static inline void set_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int num)
+{
int idx = get_irn_idx(n);
assert(idx < ARR_LEN(env->sched_info));
@@ -302,7 +304,8 @@ static inline void set_irn_not_sched_user(block_sched_env_t *env, ir_node *n, in
/**
* Add @p num to the number of not yet schedules users and returns the result.
*/
-static inline int add_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int num) {
+static inline int add_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int num)
+{
int idx = get_irn_idx(n);
assert(idx < ARR_LEN(env->sched_info));
@@ -313,7 +316,8 @@ static inline int add_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int
/**
* Returns the number of users of a node having mode datab.
*/
-static int get_num_successors(ir_node *irn) {
+static int get_num_successors(ir_node *irn)
+{
int sum = 0;
const ir_edge_t *edge;
@@ -345,7 +349,8 @@ static int get_num_successors(ir_node *irn) {
* Adds irn to @p live, updates all inputs that this user is scheduled
* and counts all of its non scheduled users.
*/
-static void update_sched_liveness(block_sched_env_t *env, ir_node *irn) {
+static void update_sched_liveness(block_sched_env_t *env, ir_node *irn)
+{
int i;
/* ignore Projs */
@@ -423,7 +428,6 @@ static void list_sched_block(ir_node *block, void *env_ptr)
{
sched_env_t *env = env_ptr;
const list_sched_selector_t *selector = env->selector;
- ir_node *start_node = get_irg_start(get_irn_irg(block));
block_sched_env_t be;
const ir_edge_t *edge;
@@ -478,12 +482,10 @@ static void list_sched_block(ir_node *block, void *env_ptr)
transfer data flow from the predecessors to this block.
*/
add_to_sched(&be, irn);
- }
- else if (irn == start_node) {
+ } else if (be_is_Start(irn)) {
/* The start block will be scheduled as the first node */
add_to_sched(&be, irn);
- }
- else {
+ } else {
/* Other nodes must have all operands in other blocks to be made
* ready */
int ready = 1;
@@ -663,8 +665,9 @@ void list_sched_single_block(const be_irg_t *birg, ir_node *block,
/**
* Register list scheduler options.
*/
-void be_init_listsched(void) {
- lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
+void be_init_listsched(void)
+{
+ lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *sched_grp = lc_opt_get_grp(be_grp, "listsched");
lc_opt_add_table(sched_grp, list_sched_option_table);