Patchwork Sched patch: better condition mutex testing

login
register
mail settings
Submitter Bernd Schmidt
Date May 27, 2011, 8:14 a.m.
Message ID <4DDF5D5B.2090707@codesourcery.com>
Download mbox | patch
Permalink /patch/97661/
State New
Headers show

Comments

Bernd Schmidt - May 27, 2011, 8:14 a.m.
When regrename is enabled, it makes new copies of its replacement
registers, which means that pointer equality tests can't be used
afterwards to check whether two regs are equal.
sched_insn_conditions_mutex_p has one such test, and it causes
pessimized code in some situations on C6X.

The following patch fixes it. Regression tested with a 4.5 c6x-elf
compiler. I tried to bootstrap ia64, but that has PR48496. Ok?


Bernd
* sched-deps.c (conditions_mutex_p): Use rtx_equal_p to compare
	registers.
Vladimir Makarov - May 30, 2011, 9:27 p.m.
On 05/27/2011 04:14 AM, Bernd Schmidt wrote:
> When regrename is enabled, it makes new copies of its replacement
> registers, which means that pointer equality tests can't be used
> afterwards to check whether two regs are equal.
> sched_insn_conditions_mutex_p has one such test, and it causes
> pessimized code in some situations on C6X.
>
> The following patch fixes it. Regression tested with a 4.5 c6x-elf
> compiler. I tried to bootstrap ia64, but that has PR48496. Ok?
>
Sure, It is ok.  Thanks, Bernd.

Patch

Index: gcc/sched-deps.c
===================================================================
--- gcc/sched-deps.c	(revision 325327)
+++ gcc/sched-deps.c	(working copy)
@@ -563,7 +563,7 @@  conditions_mutex_p (const_rtx cond1, con
 	  (rev1==rev2
 	  ? reversed_comparison_code (cond2, NULL)
 	  : GET_CODE (cond2))
-      && XEXP (cond1, 0) == XEXP (cond2, 0)
+      && rtx_equal_p (XEXP (cond1, 0), XEXP (cond2, 0))
       && XEXP (cond1, 1) == XEXP (cond2, 1))
     return 1;
   return 0;