Patchwork [lra] patch to fix GCC testsuite degradations on x86

login
register
mail settings
Submitter Vladimir Makarov
Date July 7, 2011, 7:29 p.m.
Message ID <4E1608FD.2000608@redhat.com>
Download mbox | patch
Permalink /patch/103725/
State New
Headers show

Comments

Vladimir Makarov - July 7, 2011, 7:29 p.m.
The following patch fixes all current GCC testsuite degradations of 
IRA+LRA in comparison with IRA + reload on x86 bringing IRA+LRA having 
less testsuite failures on x86 than IRA+reload.

The patch was successfully bootstrapped on x86-64, IA64, and ppc64.

2011-07-07  Vladimir Makarov <vmakarov@redhat.com>

         * lra-int.h (lra_invalidate_insn_data): New prototype.

         * lra.c (lra_invalidate_insn_data): Split out from ...
         (lra_set_insn_deleted): ... here.

         * lra-constraints.c (curr_insn_transform): Call
         lra_invalidate_insn_data and return true for wrong asm insn.
         (lra_constraints): Use dest_reg instead of SET_DEST (set).

Patch

Index: lra-int.h
===================================================================
--- lra-int.h	(revision 175931)
+++ lra-int.h	(working copy)
@@ -252,6 +252,7 @@  extern void lra_push_insn_and_update_ins
 
 extern rtx lra_create_new_reg (enum machine_mode, rtx, enum reg_class,
 			       const char *);
+extern void lra_invalidate_insn_data (rtx);
 extern void lra_set_insn_deleted (rtx);
 extern void lra_delete_dead_insn (rtx);
 extern void lra_emit_add (rtx, rtx, rtx);
Index: lra.c
===================================================================
--- lra.c	(revision 175931)
+++ lra.c	(working copy)
@@ -107,13 +107,20 @@  lra_create_new_reg (enum machine_mode md
   return new_reg;
 }
 
+/* Invalidate INSN related info used by LRA.  */
+void
+lra_invalidate_insn_data (rtx insn)
+{
+  lra_invalidate_insn_regno_info (insn);
+  invalidate_insn_recog_data (INSN_UID (insn));
+}
+
 /* Mark INSN deleted and invalidate the insn related info used by
    LRA.  */
 void
 lra_set_insn_deleted (rtx insn)
 {
-  lra_invalidate_insn_regno_info (insn);
-  invalidate_insn_recog_data (INSN_UID (insn));
+  lra_invalidate_insn_data (insn);
   SET_INSN_DELETED (insn);
 }
 
Index: lra-constraints.c
===================================================================
--- lra-constraints.c	(revision 175931)
+++ lra-constraints.c	(working copy)
@@ -2760,7 +2760,8 @@  curr_insn_transform (void)
 		     "inconsistent operand constraints in an %<asm%>");
       /* Avoid further trouble with this insn.  */
       PATTERN (curr_insn) = gen_rtx_USE (VOIDmode, const0_rtx);
-      return false;
+      lra_invalidate_insn_data (curr_insn);
+      return true;
     }
 
   /* If the best alternative is with operands 1 and 2 swapped, swap
@@ -3273,7 +3274,7 @@  lra_constraints (bool first_p)
 		       && (! MEM_P (x) || MEM_READONLY_P (x)
 			   || in_list_p (curr_insn,
 					 ira_reg_equiv
-					 [REGNO (SET_DEST (set))].init_insns)))
+					 [REGNO (dest_reg)].init_insns)))
 		      || (SET_SRC (set) != get_equiv_substitution (SET_SRC (set))
 			  && in_list_p (curr_insn,
 					ira_reg_equiv