Added getter for non address mode heuristic.
[libfirm] / ir / be / beschedtrace.c
index 52af514..e64296b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -305,10 +305,13 @@ static int get_reg_difference(trace_env_t *env, ir_node *irn) {
        for (i = get_irn_arity(irn) - 1; i >= 0; i--) {
                ir_node *in = get_irn_n(irn, i);
 
-               if (! be_is_live_end(env->liveness, block, in) &&  /* if the value lives outside of block: do not count */
-                       mode_is_datab(get_irn_mode(in))             &&  /* must be data node */
-                       ! arch_irn_is(env->arch_env, in, ignore))       /* ignore "ignore" nodes :) */
+               if (mode_is_datab(get_irn_mode(in))             &&  /* must be data node */
+                   ! arch_irn_is(env->arch_env, in, ignore)    &&  /* ignore "ignore" nodes :) */
+                   ! be_is_live_end(env->liveness, block, in)      /* if the value lives outside of block: do not count */
+
+                       ) {
                        num_in++;
+               }
        }
 
        return num_out - num_in;
@@ -391,8 +394,16 @@ static void trace_preprocess_block(trace_env_t *env, ir_node *block) {
        foreach_out_edge(block, edge) {
                ir_node *succ = get_edge_src_irn(edge);
 
-               if (is_Anchor(succ))
+               if (is_Block(succ)) {
+                       /* A Block-Block edge. This should be the MacroBlock
+                        * edge, ignore it. */
+                       assert(get_Block_MacroBlock(succ) == block && "Block-Block edge found");
                        continue;
+               }
+               if (is_Anchor(succ)) {
+                       /* ignore a keep alive edge */
+                       continue;
+               }
                if (is_root(succ, block)) {
                        mark_root_node(env, succ);
                        set_irn_link(succ, root);