public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/39423]  New: [
@ 2009-03-10 13:27 chrbr at gcc dot gnu dot org
  2009-03-10 13:34 ` [Bug target/39423] [ paolo dot carlini at oracle dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: chrbr at gcc dot gnu dot org @ 2009-03-10 13:27 UTC (permalink / raw)
  To: gcc-bugs




-- 
           Summary: [
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: chrbr at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
@ 2009-03-10 13:34 ` paolo dot carlini at oracle dot com
  2009-03-11  8:46 ` [Bug target/39423] [SH] performance regression: lost mov @(disp,Rn) chrbr at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-03-10 13:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from paolo dot carlini at oracle dot com  2009-03-10 13:34 -------
.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
  2009-03-10 13:34 ` [Bug target/39423] [ paolo dot carlini at oracle dot com
@ 2009-03-11  8:46 ` chrbr at gcc dot gnu dot org
  2009-03-11  8:53 ` chrbr at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: chrbr at gcc dot gnu dot org @ 2009-03-11  8:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from chrbr at gcc dot gnu dot org  2009-03-11 08:46 -------
I observed some large performance regressions in 4.3 and upwards for many
benchmarks for the superh targets, There are many causes but the main one is
reduced to the indirect+offset access :

int
foo (int tab[], int index)
{
  return tab [index+1];
} 

compiles (-O2 -fomit-frame-pointer) into 
        mov     r5,r0
        add     #1,r0
        shll2   r0
        rts     
        mov.l   @(r0,r4),r0

instead of
        shll2   r5
        add     r4,r5
        rts     
        mov.l   @(4,r5),r0

Note that in more complex code the problem is emphasized because only r0
register class can be used as indirect register index, putting extra pressure
on reload.

It seems to be that the problem is in the way that the constant index is now
hidden by gimple, so we now have

 return *(tab + ((unsigned int) index + 1) * 4)

instead of 

 return *(tab + 4B + (int *) ((unsigned int) index * 4))

It seems more easy to change gimple, but this is a target dependant
transformation. On the other hand the RTL code gen should be able to
redistribute the factorization, but that seems extra work to undo what was done
previously.


-- 

chrbr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |
            Summary|[                           |[SH]  performance
                   |                            |regression: lost mov
                   |                            |@(disp,Rn)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
  2009-03-10 13:34 ` [Bug target/39423] [ paolo dot carlini at oracle dot com
  2009-03-11  8:46 ` [Bug target/39423] [SH] performance regression: lost mov @(disp,Rn) chrbr at gcc dot gnu dot org
@ 2009-03-11  8:53 ` chrbr at gcc dot gnu dot org
  2009-03-11  9:06 ` ebotcazou at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: chrbr at gcc dot gnu dot org @ 2009-03-11  8:53 UTC (permalink / raw)
  To: gcc-bugs



-- 

chrbr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |chrbr at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-03-11 08:52:58
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-03-11  8:53 ` chrbr at gcc dot gnu dot org
@ 2009-03-11  9:06 ` ebotcazou at gcc dot gnu dot org
  2009-03-11  9:30 ` chrbr at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2009-03-11  9:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ebotcazou at gcc dot gnu dot org  2009-03-11 09:06 -------
See http://gcc.gnu.org/ml/gcc-patches/2008-12/msg01134.html


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-03-11  9:06 ` ebotcazou at gcc dot gnu dot org
@ 2009-03-11  9:30 ` chrbr at gcc dot gnu dot org
  2009-03-11  9:36 ` ebotcazou at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: chrbr at gcc dot gnu dot org @ 2009-03-11  9:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from chrbr at gcc dot gnu dot org  2009-03-11 09:30 -------
(In reply to comment #3)
> See http://gcc.gnu.org/ml/gcc-patches/2008-12/msg01134.html
> 

Thanks, I tried your patch against a 4.3.3 base but it didn't fix the problem,
your patch canonicalizes while what I need is a distribution
(base + 1) * 4 => base * 4 + 4


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2009-03-11  9:30 ` chrbr at gcc dot gnu dot org
@ 2009-03-11  9:36 ` ebotcazou at gcc dot gnu dot org
  2009-03-11  9:46 ` chrbr at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2009-03-11  9:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from ebotcazou at gcc dot gnu dot org  2009-03-11 09:36 -------
> Thanks, I tried your patch against a 4.3.3 base but it didn't fix the problem,
> your patch canonicalizes while what I need is a distribution

Read again the RTL expander hunk.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2009-03-11  9:36 ` ebotcazou at gcc dot gnu dot org
@ 2009-03-11  9:46 ` chrbr at gcc dot gnu dot org
  2009-03-11 10:25 ` ebotcazou at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: chrbr at gcc dot gnu dot org @ 2009-03-11  9:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from chrbr at gcc dot gnu dot org  2009-03-11 09:46 -------
(In reply to comment #5)
> > Thanks, I tried your patch against a 4.3.3 base but it didn't fix the problem,
> > your patch canonicalizes while what I need is a distribution
> 
> Read again the RTL expander hunk.
> 

ah yes sorry, when I read
"
  base + 2*ind - 2

now it's

  base + (1-ind) * -2
"
I thought that the now what as with your patch. So it looks indeed like quite
similar to what I see. I'll try to see why it doesn't solve my case.

thanks,


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-03-11  9:46 ` chrbr at gcc dot gnu dot org
@ 2009-03-11 10:25 ` ebotcazou at gcc dot gnu dot org
  2009-03-11 14:08 ` chrbr at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2009-03-11 10:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ebotcazou at gcc dot gnu dot org  2009-03-11 10:25 -------
> I thought that the now what as with your patch. So it looks indeed like quite
> similar to what I see. I'll try to see why it doesn't solve my case.

Reverting to the old canonicalization at the tree level is not doable, that's
why the patch does it during RTL expansion and only for offsets.  It probably
would need to be extended if that's not sufficient for your testcase.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2009-03-11 10:25 ` ebotcazou at gcc dot gnu dot org
@ 2009-03-11 14:08 ` chrbr at gcc dot gnu dot org
  2009-03-12 15:04 ` chrbr at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: chrbr at gcc dot gnu dot org @ 2009-03-11 14:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from chrbr at gcc dot gnu dot org  2009-03-11 14:07 -------
I have picky disabled the canonicalization in fold_plusminus_mult_expr for 
identical constants that are power of 2, so my mov @(disp, rn) is back :-(. For
some reason your patch let the base+index computation factorization thru 

This is experimental for now, because expand_expr needs to be extended to
repair expressions like return ((a * 4) + 4) that are not an indirect_ref.
(thanks we differ PLUS expr from POINTER_PLUS_EXPR)

+++ fold-const.c        2009-03-11 13:49:40.000000000 +0100
@@ -7431,7 +7431,10 @@
   same = NULL_TREE;

   if (operand_equal_p (arg01, arg11, 0))
-    same = arg01, alt0 = arg00, alt1 = arg10;
+    {
+      if (code != PLUS_EXPR || exact_log2 (TREE_INT_CST_LOW (arg01)) == -1)
+       same = arg01, alt0 = arg00, alt1 = arg10;
+    }
   else if (operand_equal_p (arg00, arg10, 0))
     same = arg00, alt0 = arg01, alt1 = arg11;
   else if (operand_equal_p (arg00, arg11, 0))


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2009-03-11 14:08 ` chrbr at gcc dot gnu dot org
@ 2009-03-12 15:04 ` chrbr at gcc dot gnu dot org
  2009-03-12 15:11 ` chrbr at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: chrbr at gcc dot gnu dot org @ 2009-03-12 15:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from chrbr at gcc dot gnu dot org  2009-03-12 15:04 -------
The attached patch improves the SH generation, but I noticed a small regression
with the ARM that could make use before of a shifted constant addressing mode,
so not using the extra register for the value.

A target description check should be done while expanding the
canonicalization, that should not be done only when a base+cst addressing mode
exists and the cst must be shifter in a register. Any input welcome to how
to target conditionalize this transformation.

No performance impact was noticed on i686 however.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2009-03-12 15:04 ` chrbr at gcc dot gnu dot org
@ 2009-03-12 15:11 ` chrbr at gcc dot gnu dot org
  2009-03-31 16:09 ` [Bug target/39423] [4.3/4.4/4.5 Regression] " jsm28 at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: chrbr at gcc dot gnu dot org @ 2009-03-12 15:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from chrbr at gcc dot gnu dot org  2009-03-12 15:10 -------
Created an attachment (id=17447)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17447&action=view)
SH illustrative patch

for feedback only. win on SH. lost on ARM

2009-03-12  Christian Bruel  <christian.bruel@st.com>

        * fold-const.c (fold_plusminus_mult_expr): Move canonicalization of
         index+cst...
        * expr.c (expand_expr_real_1): ... here.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [4.3/4.4/4.5 Regression] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2009-03-12 15:11 ` chrbr at gcc dot gnu dot org
@ 2009-03-31 16:09 ` jsm28 at gcc dot gnu dot org
  2009-03-31 19:11 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 16:09 UTC (permalink / raw)
  To: gcc-bugs



-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[SH]  performance           |[4.3/4.4/4.5 Regression]
                   |regression: lost mov        |[SH]  performance
                   |@(disp,Rn)                  |regression: lost mov
                   |                            |@(disp,Rn)
   Target Milestone|---                         |4.3.4


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [4.3/4.4/4.5 Regression] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2009-03-31 16:09 ` [Bug target/39423] [4.3/4.4/4.5 Regression] " jsm28 at gcc dot gnu dot org
@ 2009-03-31 19:11 ` jakub at gcc dot gnu dot org
  2009-08-04 12:48 ` rguenth at gcc dot gnu dot org
  2010-05-22 18:33 ` [Bug target/39423] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-03-31 19:11 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [4.3/4.4/4.5 Regression] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2009-03-31 19:11 ` jakub at gcc dot gnu dot org
@ 2009-08-04 12:48 ` rguenth at gcc dot gnu dot org
  2010-05-22 18:33 ` [Bug target/39423] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-04 12:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from rguenth at gcc dot gnu dot org  2009-08-04 12:29 -------
GCC 4.3.4 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.4                       |4.3.5


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/39423] [4.3/4.4/4.5/4.6 Regression] [SH]  performance regression: lost mov @(disp,Rn)
  2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
                   ` (13 preceding siblings ...)
  2009-08-04 12:48 ` rguenth at gcc dot gnu dot org
@ 2010-05-22 18:33 ` rguenth at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-22 18:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from rguenth at gcc dot gnu dot org  2010-05-22 18:13 -------
GCC 4.3.5 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.5                       |4.3.6


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2010-05-22 18:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-10 13:27 [Bug target/39423] New: [ chrbr at gcc dot gnu dot org
2009-03-10 13:34 ` [Bug target/39423] [ paolo dot carlini at oracle dot com
2009-03-11  8:46 ` [Bug target/39423] [SH] performance regression: lost mov @(disp,Rn) chrbr at gcc dot gnu dot org
2009-03-11  8:53 ` chrbr at gcc dot gnu dot org
2009-03-11  9:06 ` ebotcazou at gcc dot gnu dot org
2009-03-11  9:30 ` chrbr at gcc dot gnu dot org
2009-03-11  9:36 ` ebotcazou at gcc dot gnu dot org
2009-03-11  9:46 ` chrbr at gcc dot gnu dot org
2009-03-11 10:25 ` ebotcazou at gcc dot gnu dot org
2009-03-11 14:08 ` chrbr at gcc dot gnu dot org
2009-03-12 15:04 ` chrbr at gcc dot gnu dot org
2009-03-12 15:11 ` chrbr at gcc dot gnu dot org
2009-03-31 16:09 ` [Bug target/39423] [4.3/4.4/4.5 Regression] " jsm28 at gcc dot gnu dot org
2009-03-31 19:11 ` jakub at gcc dot gnu dot org
2009-08-04 12:48 ` rguenth at gcc dot gnu dot org
2010-05-22 18:33 ` [Bug target/39423] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org

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