sparc: redo and improve sparc immediate handling (low-part after sethi is now omitted...
[libfirm] / ir / be / beschednormal.c
index 46aa21b..68a6a55 100644 (file)
@@ -119,6 +119,9 @@ static int count_result(const ir_node* irn)
        if (mode == mode_M || mode == mode_X)
                return 0;
 
+       if (mode == mode_T)
+               return 1;
+
        if (arch_get_register_req_out(irn)->type & arch_register_req_type_ignore)
                return 0;
 
@@ -194,9 +197,14 @@ static int normal_tree_cost(ir_node* irn, instance_t *inst)
        last = 0;
        for (i = 0; i < arity; ++i) {
                ir_node* op = fc->costs[i].irn;
-               if (op == last)                 continue;
-               if (get_irn_mode(op) == mode_M) continue;
-               if (arch_irn_is_ignore(op))     continue;
+               ir_mode* mode;
+               if (op == last)
+                       continue;
+               mode = get_irn_mode(op);
+               if (mode == mode_M)
+                       continue;
+               if (mode != mode_T && arch_irn_is_ignore(op))
+                       continue;
                cost = MAX(fc->costs[i].cost + n_op_res, cost);
                last = op;
                ++n_op_res;
@@ -369,10 +377,9 @@ static void normal_sched_block(ir_node* block, void* env)
 
 
 static void *normal_init_graph(const list_sched_selector_t *vtab,
-                               const be_irg_t *birg)
+                               ir_graph *irg)
 {
        instance_t* inst = XMALLOC(instance_t);
-       ir_graph*   irg = be_get_birg_irg(birg);
        heights_t*  heights;
 
        (void)vtab;
@@ -421,7 +428,7 @@ static void *normal_init_block(void *graph_env, ir_node *block)
        return inst;
 }
 
-void normal_finish_graph(void *env)
+static void normal_finish_graph(void *env)
 {
        instance_t *inst = env;