used enum values for Tuple creation
[libfirm] / ir / ana / irscc.c
index eb3d6a0..8713d82 100644 (file)
@@ -417,6 +417,8 @@ ir_node *get_loop_node (ir_loop *loop, int pos) {
     if(node_nr == pos)
       return(loop -> children[child_nr].node);
   }
+  DDML(loop);
+  printf("pos: %d\n", pos);
   assert(0 && "no child at pos found");
   return NULL;
 }
@@ -589,10 +591,24 @@ static bool is_outermost_Start(ir_node *n) {
 /* Don't walk from nodes to blocks except for Control flow operations. */
 static INLINE int
 get_start_index(ir_node *n) {
+#if 1
   if (is_cfop(n) || is_fragile_op(n) || intern_get_irn_op(n) == op_Start)
+      // this should be sufficient.
     return -1;
   else
     return 0;
+#else
+  /* This version causes deeper loop trees (at least we verified this for Polymor).
+     But it guarantees that Blocks are analysed before nodes contained in the
+     block.  If so, we can set the value to undef if the block is not executed. */
+  if (intern_get_irn_op(n) == op_Phi   ||
+      intern_get_irn_op(n) == op_Block ||
+      (intern_get_irn_op(n) == op_Filter && interprocedural_view))
+    // Here we could test for backedge at -1 which is illegal
+    return 0;
+  else
+    return -1;
+#endif
 }
 #if 0
 /* Returns current_ir_graph and set it to the irg of predecessor index