+static void TEMPLATE_copy_attr(ir_graph *irg, const ir_node *old_node,
+ ir_node *new_node)
+{
+ struct obstack *obst = get_irg_obstack(irg);
+ const void *attr_old = get_irn_generic_attr_const(old_node);
+ void *attr_new = get_irn_generic_attr(new_node);
+ backend_info_t *old_info = be_get_info(old_node);
+ backend_info_t *new_info = be_get_info(new_node);
+
+ /* copy the attributes */
+ memcpy(attr_new, attr_old, get_op_attr_size(get_irn_op(old_node)));
+
+ /* copy out flags */
+ new_info->flags = old_info->flags;
+ new_info->out_infos =
+ DUP_ARR_D(reg_out_info_t, obst, old_info->out_infos);
+ new_info->in_reqs = old_info->in_reqs;
+}
+