get_irn_irg(ir_node *node) {
if (get_irn_op(node) != op_Block)
node = get_nodes_block(node);
+ if (is_Bad(node)) /* sometimes bad is predecessor of nodes instead of block: in case of optimization */
+ node = get_nodes_block(node);
assert(get_irn_op(node) == op_Block);
return node->attr.block.irg;
}
return node;
}
+/** returns operand of node if node is a Cast */
+ir_node *skip_Cast (ir_node *node) {
+ if (node && get_irn_op(node) == op_Cast) {
+ return skip_nop(get_irn_n(node, 0));
+ } else {
+ return node;
+ }
+}
+
#if 0
/* This should compact Id-cycles to self-cycles. It has the same (or less?) complexity
than any other approach, as Id chains are resolved and all point to the real node, or
/* returns corresponding operand of Tuple if node is a Proj from
a Tuple. */
ir_node *skip_Tuple (ir_node *node);
+/** returns operand of node if node is a Cast */
+ir_node *skip_Cast (ir_node *node);
/** returns true if node is a Bad node. */
int is_Bad (ir_node *node);
/** returns true if the node is not a Block */