- n = get_irn_link(n);
- } while(n != NULL);
-}
-
-static int is_modify_flags(ir_node *node) {
- int i, arity;
-
- if(arch_irn_is(arch_env, node, modify_flags))
- return 1;
- if(!be_is_Keep(node))
- return 0;
-
- arity = get_irn_arity(node);
- for(i = 0; i < arity; ++i) {
- ir_node *in = get_irn_n(node, i);
- in = skip_Proj(in);
- if(arch_irn_is(arch_env, in, modify_flags))
- return 1;
+ n = (ir_node*)get_irn_link(n);
+ } while (n != NULL);
+
+ /* No need to introduce the copy, because it only lives in this block, but
+ * we have to update the liveness of all operands */
+ if (is_Block(node) ||
+ get_nodes_block(node) != get_nodes_block(flags_needed)) {
+ ir_graph *irg = get_irn_irg(node);
+ be_lv_t *lv = be_get_irg_liveness(irg);
+ int i;
+
+ if (lv != NULL) {
+ for (i = get_irn_arity(copy) - 1; i >= 0; --i) {
+ be_liveness_update(lv, get_irn_n(copy, i));
+ }
+ }