public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/19581] New: Missed store monition on the tree level (on PPC in general)
@ 2005-01-23 1:43 pinskia at gcc dot gnu dot org
2005-01-23 1:45 ` [Bug tree-optimization/19581] " pinskia at gcc dot gnu dot org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-23 1:43 UTC (permalink / raw)
To: gcc-bugs
This is like PR 19580 but a request to optimize it on the tree level instead of just on the RTL level.
Mainly because we don't catch it for PPC (with 3.3.3 or with -fno-gcse).
int r[6];
void f (int n)
{
while (-- n)
{
r [0] += r [5];
r [1] += r [0];
r [2] += r [1];
r [3] += r [2];
r [4] += r [3];
r [5] += r [4];
}
}
We should be able to pull out the load and stores for r[0] ... r[5].
If we do it on the tree level, we also just fix the problem for 4.0 also (but I think this might need more
aliasing analysis or I could be wrong).
--
Summary: Missed store monition on the tree level (on PPC in
general)
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: missed-optimization, alias, TREE
Severity: enhancement
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19581
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/19581] Missed store monition on the tree level (on PPC in general)
2005-01-23 1:43 [Bug tree-optimization/19581] New: Missed store monition on the tree level (on PPC in general) pinskia at gcc dot gnu dot org
@ 2005-01-23 1:45 ` pinskia at gcc dot gnu dot org
2005-01-23 1:47 ` dberlin at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-23 1:45 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |19580
nThis| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19581
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/19581] Missed store monition on the tree level (on PPC in general)
2005-01-23 1:43 [Bug tree-optimization/19581] New: Missed store monition on the tree level (on PPC in general) pinskia at gcc dot gnu dot org
2005-01-23 1:45 ` [Bug tree-optimization/19581] " pinskia at gcc dot gnu dot org
@ 2005-01-23 1:47 ` dberlin at gcc dot gnu dot org
2005-01-23 19:27 ` steven at gcc dot gnu dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2005-01-23 1:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dberlin at gcc dot gnu dot org 2005-01-23 01:47 -------
This needs more alias analysis
Structure aliasing could do this with a little work, so i'll take this for now
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |dberlin at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-01-23 01:47:51
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19581
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/19581] Missed store monition on the tree level (on PPC in general)
2005-01-23 1:43 [Bug tree-optimization/19581] New: Missed store monition on the tree level (on PPC in general) pinskia at gcc dot gnu dot org
2005-01-23 1:45 ` [Bug tree-optimization/19581] " pinskia at gcc dot gnu dot org
2005-01-23 1:47 ` dberlin at gcc dot gnu dot org
@ 2005-01-23 19:27 ` steven at gcc dot gnu dot org
2005-01-23 19:30 ` [Bug tree-optimization/19581] Missed store monition on the tree level steven at gcc dot gnu dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-01-23 19:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-01-23 19:27 -------
Right now it is the *old* loop optimizer that promotes the array elements
to registers. How about that.
Is there an "old loop optimizer" meta bug? We'll probably want to do this
elsewhere before the old loop optimizer can die.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |rakdver at gcc dot gnu dot
| |org, steven at gcc dot gnu
| |dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19581
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/19581] Missed store monition on the tree level
2005-01-23 1:43 [Bug tree-optimization/19581] New: Missed store monition on the tree level (on PPC in general) pinskia at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-01-23 19:27 ` steven at gcc dot gnu dot org
@ 2005-01-23 19:30 ` steven at gcc dot gnu dot org
2005-01-23 19:44 ` rakdver at gcc dot gnu dot org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-01-23 19:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-01-23 19:29 -------
Has nothing to do with PPC
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|Missed store monition on the|Missed store monition on the
|tree level (on PPC in |tree level
|general) |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19581
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/19581] Missed store monition on the tree level
2005-01-23 1:43 [Bug tree-optimization/19581] New: Missed store monition on the tree level (on PPC in general) pinskia at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-01-23 19:30 ` [Bug tree-optimization/19581] Missed store monition on the tree level steven at gcc dot gnu dot org
@ 2005-01-23 19:44 ` rakdver at gcc dot gnu dot org
2005-01-23 19:53 ` steven at gcc dot gnu dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2005-01-23 19:44 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rakdver at gcc dot gnu dot org 2005-01-23 19:44 -------
Gcse store motion could catch this as well (if I understand PR 19580 well, it
does not, which is a bug), so this pr alone would not be a reason to block
removal of old loop optimizer. However hopefully we should have a usable alias
analysis
on tree level in 4.1, of course.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19581
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/19581] Missed store monition on the tree level
2005-01-23 1:43 [Bug tree-optimization/19581] New: Missed store monition on the tree level (on PPC in general) pinskia at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-01-23 19:44 ` rakdver at gcc dot gnu dot org
@ 2005-01-23 19:53 ` steven at gcc dot gnu dot org
2005-01-23 20:00 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-01-23 19:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-01-23 19:53 -------
GCSE store motion does catch this. But it is disabled for GCC 4.0 because
it is buggy and does not really work well in most cases.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19581
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/19581] Missed store monition on the tree level
2005-01-23 1:43 [Bug tree-optimization/19581] New: Missed store monition on the tree level (on PPC in general) pinskia at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-01-23 19:53 ` steven at gcc dot gnu dot org
@ 2005-01-23 20:00 ` pinskia at gcc dot gnu dot org
2005-01-23 20:01 ` rakdver at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-23 20:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-23 19:59 -------
(In reply to comment #5)
> GCSE store motion does catch this. But it is disabled for GCC 4.0 because
> it is buggy and does not really work well in most cases.
Yes but we don't catch in 3.4.0 so that means GCSE store motion did not catch it since GCSE store
motion was only disabled for 4.0.0 but was enabled after the rewrite for 3.4.0.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19581
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/19581] Missed store monition on the tree level
2005-01-23 1:43 [Bug tree-optimization/19581] New: Missed store monition on the tree level (on PPC in general) pinskia at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-01-23 20:00 ` pinskia at gcc dot gnu dot org
@ 2005-01-23 20:01 ` rakdver at gcc dot gnu dot org
2005-07-26 13:21 ` [Bug tree-optimization/19581] Missed store motion " dberlin at gcc dot gnu dot org
2005-07-26 13:59 ` rguenth at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2005-01-23 20:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rakdver at gcc dot gnu dot org 2005-01-23 20:01 -------
The same holds for the old loop optimizer :-)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19581
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/19581] Missed store motion on the tree level
2005-01-23 1:43 [Bug tree-optimization/19581] New: Missed store monition on the tree level (on PPC in general) pinskia at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-01-23 20:01 ` rakdver at gcc dot gnu dot org
@ 2005-07-26 13:21 ` dberlin at gcc dot gnu dot org
2005-07-26 13:59 ` rguenth at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2005-07-26 13:21 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dberlin at gcc dot gnu dot org 2005-07-26 13:18 -------
Richard guenther is working on aliasing for arrays, i'll leave this one for him
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
AssignedTo|dberlin at gcc dot gnu dot |unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19581
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/19581] Missed store motion on the tree level
2005-01-23 1:43 [Bug tree-optimization/19581] New: Missed store monition on the tree level (on PPC in general) pinskia at gcc dot gnu dot org
` (8 preceding siblings ...)
2005-07-26 13:21 ` [Bug tree-optimization/19581] Missed store motion " dberlin at gcc dot gnu dot org
@ 2005-07-26 13:59 ` rguenth at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-07-26 13:59 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-07-26 13:29 -------
For a reduced array with only 4 elements (I know - this should be a --param) we
now get in .vars (with the array aliasing patch):
f (n)
{
int n.39;
unsigned int ivtmp.33;
int lsm_tmp.32;
int lsm_tmp.31;
int lsm_tmp.30;
int lsm_tmp.29;
<bb 0>:
n.39 = n - 1;
if (n.39 != 0) goto <L6>; else goto <L2>;
<L6>:;
lsm_tmp.29 = r[2];
lsm_tmp.30 = r[1];
lsm_tmp.31 = r[3];
lsm_tmp.32 = r[0];
ivtmp.33 = 0;
<L0>:;
lsm_tmp.32 = lsm_tmp.32 + lsm_tmp.31;
lsm_tmp.30 = lsm_tmp.32 + lsm_tmp.30;
lsm_tmp.29 = lsm_tmp.30 + lsm_tmp.29;
lsm_tmp.31 = lsm_tmp.31 + lsm_tmp.29;
ivtmp.33 = ivtmp.33 + 1;
if (ivtmp.33 != (unsigned int) n.39) goto <L0>; else goto <L10>;
<L10>:;
r[2] = lsm_tmp.29;
r[1] = lsm_tmp.30;
r[3] = lsm_tmp.31;
r[0] = lsm_tmp.32;
<L2>:;
return;
}
and the asm loop looks like
.L4:
addl %edx, %eax
incl %esi
addl %eax, %ecx
addl %ecx, %ebx
addl %ebx, %edx
cmpl %edi, %esi
jne .L4
as in exactly what you want. Don't hold your breath for 4.1, though.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2005-06-09 16:37:28 |2005-07-26 13:29:06
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19581
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2005-07-26 13:29 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-23 1:43 [Bug tree-optimization/19581] New: Missed store monition on the tree level (on PPC in general) pinskia at gcc dot gnu dot org
2005-01-23 1:45 ` [Bug tree-optimization/19581] " pinskia at gcc dot gnu dot org
2005-01-23 1:47 ` dberlin at gcc dot gnu dot org
2005-01-23 19:27 ` steven at gcc dot gnu dot org
2005-01-23 19:30 ` [Bug tree-optimization/19581] Missed store monition on the tree level steven at gcc dot gnu dot org
2005-01-23 19:44 ` rakdver at gcc dot gnu dot org
2005-01-23 19:53 ` steven at gcc dot gnu dot org
2005-01-23 20:00 ` pinskia at gcc dot gnu dot org
2005-01-23 20:01 ` rakdver at gcc dot gnu dot org
2005-07-26 13:21 ` [Bug tree-optimization/19581] Missed store motion " dberlin at gcc dot gnu dot org
2005-07-26 13:59 ` 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).