public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/38513] New: Only postreload will remove a no-op store
@ 2008-12-13 2:36 pinskia at gcc dot gnu dot org
2008-12-13 2:37 ` [Bug tree-optimization/38513] " pinskia at gcc dot gnu dot org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-13 2:36 UTC (permalink / raw)
To: gcc-bugs
Take:
struct f{
float a;
float b;
float c;
float d;
};
struct f a;
void h(float, float, float, float);
void g(void)
{
float a1 = a.a, b = a.b, c = a.c, d = a.d;
a.a = a1;
a.b = b;
a.c = c;
a.d = d;
h(a1, b, c, d);
}
--- CUT ---
Currently only postreload will remove the store back to a.a, a.b, a.c, and a.d.
Note this code orginally came from inlined code and was just reduced to this.
And if this was done before postreload, we don't need a fmr which was produced
by the register allocator.
--
Summary: Only postreload will remove a no-op store
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38513
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/38513] Only postreload will remove a no-op store
2008-12-13 2:36 [Bug tree-optimization/38513] New: Only postreload will remove a no-op store pinskia at gcc dot gnu dot org
@ 2008-12-13 2:37 ` pinskia at gcc dot gnu dot org
2008-12-13 2:39 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-13 2:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-12-13 02:35 -------
Also note if we do -Dfloat=int on a target like PPC, the stores are not removed
because postreloadcse does not understand mode changes that well.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38513
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/38513] Only postreload will remove a no-op store
2008-12-13 2:36 [Bug tree-optimization/38513] New: Only postreload will remove a no-op store pinskia at gcc dot gnu dot org
2008-12-13 2:37 ` [Bug tree-optimization/38513] " pinskia at gcc dot gnu dot org
@ 2008-12-13 2:39 ` pinskia at gcc dot gnu dot org
2008-12-29 18:23 ` rguenth at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-13 2:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2008-12-13 02:37 -------
(In reply to comment #1)
> Also note if we do -Dfloat=int on a target like PPC, the stores are not removed
> because postreloadcse does not understand mode changes that well.
I should say PPC64 or -Dfloat=short for PPC.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38513
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/38513] Only postreload will remove a no-op store
2008-12-13 2:36 [Bug tree-optimization/38513] New: Only postreload will remove a no-op store pinskia at gcc dot gnu dot org
2008-12-13 2:37 ` [Bug tree-optimization/38513] " pinskia at gcc dot gnu dot org
2008-12-13 2:39 ` pinskia at gcc dot gnu dot org
@ 2008-12-29 18:23 ` rguenth at gcc dot gnu dot org
2008-12-29 19:24 ` rguenth at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-29 18:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2008-12-29 18:21 -------
I have a FRE patch.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-12-29 18:21:58
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38513
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/38513] Only postreload will remove a no-op store
2008-12-13 2:36 [Bug tree-optimization/38513] New: Only postreload will remove a no-op store pinskia at gcc dot gnu dot org
` (2 preceding siblings ...)
2008-12-29 18:23 ` rguenth at gcc dot gnu dot org
@ 2008-12-29 19:24 ` rguenth at gcc dot gnu dot org
2008-12-29 19:38 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-29 19:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from rguenth at gcc dot gnu dot org 2008-12-29 19:23 -------
Created an attachment (id=17002)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17002&action=view)
patch
The idea is simple - delete redundant stores whose RHS have the same
value-number
as the LHS.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38513
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/38513] Only postreload will remove a no-op store
2008-12-13 2:36 [Bug tree-optimization/38513] New: Only postreload will remove a no-op store pinskia at gcc dot gnu dot org
` (3 preceding siblings ...)
2008-12-29 19:24 ` rguenth at gcc dot gnu dot org
@ 2008-12-29 19:38 ` pinskia at gcc dot gnu dot org
2008-12-29 19:39 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-29 19:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2008-12-29 19:36 -------
*** Bug 21000 has been marked as a duplicate of this bug. ***
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38513
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/38513] Only postreload will remove a no-op store
2008-12-13 2:36 [Bug tree-optimization/38513] New: Only postreload will remove a no-op store pinskia at gcc dot gnu dot org
` (4 preceding siblings ...)
2008-12-29 19:38 ` pinskia at gcc dot gnu dot org
@ 2008-12-29 19:39 ` pinskia at gcc dot gnu dot org
2008-12-29 19:40 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-29 19:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2008-12-29 19:38 -------
(In reply to comment #4)
> The idea is simple - delete redundant stores whose RHS have the same
> value-number as the LHS.
Which is basically what postreload CSE does really:
if (!count && reload_cse_noop_set_p (body))
{
rtx value = SET_DEST (body);
if (REG_P (value)
&& ! REG_FUNCTION_VALUE_P (value))
value = 0;
delete_insn_and_edges (insn);
return;
}
:)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38513
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/38513] Only postreload will remove a no-op store
2008-12-13 2:36 [Bug tree-optimization/38513] New: Only postreload will remove a no-op store pinskia at gcc dot gnu dot org
` (5 preceding siblings ...)
2008-12-29 19:39 ` pinskia at gcc dot gnu dot org
@ 2008-12-29 19:40 ` pinskia at gcc dot gnu dot org
2009-03-28 10:11 ` rguenth at gcc dot gnu dot org
2009-03-28 10:12 ` rguenth at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-29 19:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2008-12-29 19:39 -------
One more testcase, we miss a sibcalling optimization due to this (this is
originally from PR 2100):
int i;
int g(void) __attribute__((pure));
int f()
{
int t = i;
int t1 = g();
i = t;
return t1;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38513
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/38513] Only postreload will remove a no-op store
2008-12-13 2:36 [Bug tree-optimization/38513] New: Only postreload will remove a no-op store pinskia at gcc dot gnu dot org
` (6 preceding siblings ...)
2008-12-29 19:40 ` pinskia at gcc dot gnu dot org
@ 2009-03-28 10:11 ` rguenth at gcc dot gnu dot org
2009-03-28 10:12 ` rguenth at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-03-28 10:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from rguenth at gcc dot gnu dot org 2009-03-28 10:11 -------
Subject: Bug 38513
Author: rguenth
Date: Sat Mar 28 10:11:14 2009
New Revision: 145172
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145172
Log:
2009-03-28 Richard Guenther <rguenther@suse.de>
PR tree-optimization/38513
* tree-ssa-pre.c (eliminate): Remove redundant stores.
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle
EXC_PTR_EXPR and FILTER_EXPR.
(get_ref_from_reference_ops): Likewise.
* gcc.dg/tree-ssa/ssa-fre-21.c: New testcase.
* gcc.dg/tree-ssa/ssa-dse-11.c: Adjust.
* gcc.dg/vect/vect-reduc-dot-u8a.c: Likewise.
* gcc.dg/vect/vect-reduc-dot-u8b.c: Likewise.
* gcc.dg/vect/slp-widen-mult-u8.c: Likewise.
* gcc.dg/vect/vect-multitypes-16.c: Likewise.
* gcc.dg/vect/vect-35.c: Likewise.
* gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c: Likewise.
* gcc.dg/vect/vect-multitypes-17.c: Likewise.
* gcc.dg/vect/slp-widen-mult-s16.c: Likewise.
Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-21.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-11.c
trunk/gcc/testsuite/gcc.dg/vect/slp-widen-mult-s16.c
trunk/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c
trunk/gcc/testsuite/gcc.dg/vect/vect-35.c
trunk/gcc/testsuite/gcc.dg/vect/vect-multitypes-16.c
trunk/gcc/testsuite/gcc.dg/vect/vect-multitypes-17.c
trunk/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c
trunk/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8b.c
trunk/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c
trunk/gcc/tree-ssa-pre.c
trunk/gcc/tree-ssa-sccvn.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38513
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/38513] Only postreload will remove a no-op store
2008-12-13 2:36 [Bug tree-optimization/38513] New: Only postreload will remove a no-op store pinskia at gcc dot gnu dot org
` (7 preceding siblings ...)
2009-03-28 10:11 ` rguenth at gcc dot gnu dot org
@ 2009-03-28 10:12 ` rguenth at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-03-28 10:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from rguenth at gcc dot gnu dot org 2009-03-28 10:12 -------
Fixed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38513
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-03-28 10:12 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-13 2:36 [Bug tree-optimization/38513] New: Only postreload will remove a no-op store pinskia at gcc dot gnu dot org
2008-12-13 2:37 ` [Bug tree-optimization/38513] " pinskia at gcc dot gnu dot org
2008-12-13 2:39 ` pinskia at gcc dot gnu dot org
2008-12-29 18:23 ` rguenth at gcc dot gnu dot org
2008-12-29 19:24 ` rguenth at gcc dot gnu dot org
2008-12-29 19:38 ` pinskia at gcc dot gnu dot org
2008-12-29 19:39 ` pinskia at gcc dot gnu dot org
2008-12-29 19:40 ` pinskia at gcc dot gnu dot org
2009-03-28 10:11 ` rguenth at gcc dot gnu dot org
2009-03-28 10:12 ` 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).