In the RA constraint handler insert no copy when an operand is used more than once...
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 17 Oct 2007 12:07:06 +0000 (12:07 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 17 Oct 2007 12:07:06 +0000 (12:07 +0000)
[r16244]

ir/be/bechordal.c

index 3246d43..6df7999 100644 (file)
@@ -293,6 +293,11 @@ static ir_node *prepare_constr_insn(be_chordal_env_t *env, ir_node *irn)
                        if(a_op->carrier != op->carrier || !a_op->has_constraints)
                                continue;
 
+                       /* if the constraint is the same, no copy is necessary
+                        * TODO generalise unequal but overlapping constraints */
+                       if (a_op->req == op->req)
+                               continue;
+
                        if (be_is_Copy(get_irn_n(insn->irn, a_op->pos)))
                                continue;