public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [lra] patch to fix GCC testsuite degradations on x86
@ 2011-07-07 19:53 Vladimir Makarov
  0 siblings, 0 replies; only message in thread
From: Vladimir Makarov @ 2011-07-07 19:53 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 680 bytes --]

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).


[-- Attachment #2: july7.patch --]
[-- Type: text/plain, Size: 2091 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-07 19:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-07 19:53 [lra] patch to fix GCC testsuite degradations on x86 Vladimir Makarov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).