/**
* 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));
/**
* 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));
/**
* 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));
/**
* 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;
* 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 */
{
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;
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;
DEL_ARR_F(env.sched_info);
}
-/**
- * Register list scheduler options.
- */
-void be_init_listsched(void) {
- lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_listsched);
+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);
FIRM_DBG_REGISTER(dbg, "firm.be.sched");
}
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_listsched);