public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/30735] New: 50% slow down due to mem-ssa merge
@ 2007-02-08 16:58 hjl at lucon dot org
2007-02-08 17:01 ` [Bug tree-optimization/30735] " hjl at lucon dot org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: hjl at lucon dot org @ 2007-02-08 16:58 UTC (permalink / raw)
To: gcc-bugs
There is a huge regression of gcc 4.3 performance detected on
cpu2006/454.calculix benchmark at -O2 optimization level on
x86_64-redhat-linux.
Regression is caused by mem-ssa merge 12/12/2006 (revision 119760).
http://gcc.gnu.org/viewcvs?view=rev&revision=119760
mem-ssa merge may introduce unnecessary memory <-> register moves.
--
Summary: 50% slow down due to mem-ssa merge
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hjl at lucon dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30735
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/30735] 50% slow down due to mem-ssa merge
2007-02-08 16:58 [Bug tree-optimization/30735] New: 50% slow down due to mem-ssa merge hjl at lucon dot org
@ 2007-02-08 17:01 ` hjl at lucon dot org
2007-02-08 17:08 ` rguenth at gcc dot gnu dot org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: hjl at lucon dot org @ 2007-02-08 17:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from hjl at lucon dot org 2007-02-08 17:01 -------
Created an attachment (id=13021)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13021&action=view)
A testcase
# /usr/gcc-good/bin/gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /net/gnu-13/export/gnu/src/gcc/gcc/configure
--enable-clocale=gnu --with-system-zlib --with-demangler-in-ld --enable-shared
--enable-threads=posix --enable-haifa --enable-checking=assert
--prefix=/usr/gcc-4.3 --with-local-prefix=/usr/local
Thread model: posix
gcc version 4.3.0 20061211 (experimental) [trunk revision 119728]
# /usr/gcc-4.3/bin/gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /net/gnu-13/export/gnu/src/gcc/gcc/configure
--enable-clocale=gnu --with-system-zlib --enable-decimal-float=yes
--with-demangler-in-ld --enable-shared --enable-threads=posix --enable-haifa
--enable-checking=assert --prefix=/usr/gcc-4.3 --with-local-prefix=/usr/local
Thread model: posix
gcc version 4.3.0 20070206 (experimental) [trunk revision 121636]
# make
/usr/gcc-good/bin/gfortran -c -O2 -ffast-math -static -o old.o e_c3d.f
/usr/gcc-4.3/bin/gfortran -O2 -ffast-math -static -c -o tr535.o tr535.f
/usr/gcc-4.3/bin/gfortran -O2 -ffast-math -static -o old old.o tr535.o
/usr/gcc-4.3/bin/gfortran -c -O2 -ffast-math -static -o new.o e_c3d.f
/usr/gcc-4.3/bin/gfortran -O2 -ffast-math -static -o new new.o tr535.o
time ./old
0.03user 0.00system 0:00.03elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+82minor)pagefaults 0swaps
time ./new
0.10user 0.00system 0:00.10elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+83minor)pagefaults 0swaps
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30735
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/30735] 50% slow down due to mem-ssa merge
2007-02-08 16:58 [Bug tree-optimization/30735] New: 50% slow down due to mem-ssa merge hjl at lucon dot org
2007-02-08 17:01 ` [Bug tree-optimization/30735] " hjl at lucon dot org
@ 2007-02-08 17:08 ` rguenth at gcc dot gnu dot org
2007-02-08 17:13 ` hjl at lucon dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-08 17:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2007-02-08 17:07 -------
Try one of the partitioning patches I proposed.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30735
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/30735] 50% slow down due to mem-ssa merge
2007-02-08 16:58 [Bug tree-optimization/30735] New: 50% slow down due to mem-ssa merge hjl at lucon dot org
2007-02-08 17:01 ` [Bug tree-optimization/30735] " hjl at lucon dot org
2007-02-08 17:08 ` rguenth at gcc dot gnu dot org
@ 2007-02-08 17:13 ` hjl at lucon dot org
2007-02-08 18:42 ` dnovillo at gcc dot gnu dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: hjl at lucon dot org @ 2007-02-08 17:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from hjl at lucon dot org 2007-02-08 17:13 -------
(In reply to comment #2)
> Try one of the partitioning patches I proposed.
>
Which one? Please provide a link or attach it here. Thanks.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30735
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/30735] 50% slow down due to mem-ssa merge
2007-02-08 16:58 [Bug tree-optimization/30735] New: 50% slow down due to mem-ssa merge hjl at lucon dot org
` (2 preceding siblings ...)
2007-02-08 17:13 ` hjl at lucon dot org
@ 2007-02-08 18:42 ` dnovillo at gcc dot gnu dot org
2007-02-13 0:59 ` dnovillo at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2007-02-08 18:42 UTC (permalink / raw)
To: gcc-bugs
--
dnovillo at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |dnovillo at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-02-08 18:42:31
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30735
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/30735] 50% slow down due to mem-ssa merge
2007-02-08 16:58 [Bug tree-optimization/30735] New: 50% slow down due to mem-ssa merge hjl at lucon dot org
` (3 preceding siblings ...)
2007-02-08 18:42 ` dnovillo at gcc dot gnu dot org
@ 2007-02-13 0:59 ` dnovillo at gcc dot gnu dot org
2007-02-15 23:37 ` pthaugen at us dot ibm dot com
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2007-02-13 0:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from dnovillo at gcc dot gnu dot org 2007-02-13 00:59 -------
I have now reproduced this locally and I'm working on a fix.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30735
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/30735] 50% slow down due to mem-ssa merge
2007-02-08 16:58 [Bug tree-optimization/30735] New: 50% slow down due to mem-ssa merge hjl at lucon dot org
` (4 preceding siblings ...)
2007-02-13 0:59 ` dnovillo at gcc dot gnu dot org
@ 2007-02-15 23:37 ` pthaugen at us dot ibm dot com
2007-03-07 0:44 ` [Bug tree-optimization/30735] [4.3 Regression] " pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pthaugen at us dot ibm dot com @ 2007-02-15 23:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pthaugen at us dot ibm dot com 2007-02-15 23:36 -------
Seeing similar behavior on PPC for CPU2000. Comparing revisions 119759 and
119760, 179.art degrades 24% and 200.sixtrack degrades 50%.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30735
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/30735] [4.3 Regression] 50% slow down due to mem-ssa merge
2007-02-08 16:58 [Bug tree-optimization/30735] New: 50% slow down due to mem-ssa merge hjl at lucon dot org
` (5 preceding siblings ...)
2007-02-15 23:37 ` pthaugen at us dot ibm dot com
@ 2007-03-07 0:44 ` pinskia at gcc dot gnu dot org
2007-04-11 16:14 ` dnovillo at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-07 0:44 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|50% slow down due to mem-ssa|[4.3 Regression] 50% slow
|merge |down due to mem-ssa merge
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30735
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/30735] [4.3 Regression] 50% slow down due to mem-ssa merge
2007-02-08 16:58 [Bug tree-optimization/30735] New: 50% slow down due to mem-ssa merge hjl at lucon dot org
` (6 preceding siblings ...)
2007-03-07 0:44 ` [Bug tree-optimization/30735] [4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-04-11 16:14 ` dnovillo at gcc dot gnu dot org
2007-06-29 17:52 ` mmitchel at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2007-04-11 16:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from dnovillo at gcc dot gnu dot org 2007-04-11 17:14 -------
Subject: Bug 30735
Author: dnovillo
Date: Wed Apr 11 17:14:06 2007
New Revision: 123719
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123719
Log:
PR 30735
PR 31090
* doc/invoke.texi: Document --params max-aliased-vops and
avg-aliased-vops.
* tree-ssa-operands.h (get_mpt_for, dump_memory_partitions,
debug_memory_partitions): Move to tree-flow.h
* params.h (AVG_ALIASED_VOPS): Define.
* tree-ssa-alias.c (struct mp_info_def): Remove. Update all
users.
(mp_info_t): Likewise.
(get_mem_sym_stats_for): New.
(set_memory_partition): Move from tree-flow-inline.h.
(mark_non_addressable): Only clear the set of symbols for the
partition if it exists.
(dump_memory_partitions): Move from tree-ssa-operands.c
(debug_memory_partitions): Likewise.
(need_to_partition_p): New.
(dump_mem_ref_stats): New.
(debug_mem_ref_stats): New.
(dump_mem_sym_stats): New.
(debug_mem_sym_stats): New.
(update_mem_sym_stats_from_stmt): New.
(compare_mp_info_entries): New.
(mp_info_cmp): Call it.
(sort_mp_info): Change argument to a list of mem_sym_stats_t
objects.
(get_mpt_for): Move from tree-ssa-operands.c.
(find_partition_for): New.
(create_partition_for): Remove.
(estimate_vop_reduction): New.
(update_reference_counts): New.
(build_mp_info): New.
(compute_memory_partitions): Refactor.
Document new heuristic.
Call build_mp_info, update_reference_counts,
find_partition_for and estimate_vop_reduction.
(compute_may_aliases): Populate virtual operands before
calling debugging dumps.
(delete_mem_sym_stats): New.
(delete_mem_ref_stats): New.
(init_mem_ref_stats): New.
(init_alias_info): Call it.
(maybe_create_global_var): Remove alias_info argument.
Get number of call sites and number of pure/const call sites
from gimple_mem_ref_stats().
(dump_alias_info): Call dump_memory_partitions first.
(dump_points_to_info_for): Show how many times a pointer has
been dereferenced.
* opts.c (decode_options): For -O2 set --param
max-aliased-vops to 500.
For -O3 set --param max-aliased-vops to 1000 and --param
avg-aliased-vops to 3.
* fortran/options.c (gfc_init_options): Remove assignment to
MAX_ALIASED_VOPS.
* tree-flow-inline.h (gimple_mem_ref_stats): New.
* tree-dfa.c (dump_variable): Dump memory reference
statistics.
Dump NO_ALIAS* settings.
(referenced_var_lookup): Tidy.
(mem_sym_stats): New.
* tree-ssa-copy.c (may_propagate_copy): Return true if DEST
and ORIG are different SSA names for a memory partition.
* tree-ssa.c (delete_tree_ssa): Call delete_mem_ref_stats.
* tree-flow.h (struct mem_sym_stats_d): Define.
(mem_sym_stats_t): Define.
(struct mem_ref_stats_d): Define.
(struct gimple_df): Add field mem_ref_stats.
(enum noalias_state): Define.
(struct var_ann_d): Add bitfield noalias_state.
(mem_sym_stats, delete_mem_ref_stats, dump_mem_ref_stats,
debug_mem_ref_stats, debug_memory_partitions,
debug_mem_sym_stats): Declare.
* tree-ssa-structalias.c (update_alias_info): Update call
sites, pure/const call sites and asm sites in structure
returned by gimple_mem_ref_stats.
Remove local variable IS_POTENTIAL_DEREF.
Increase NUM_DEREFS if the memory expression is a potential
dereference.
Call update_mem_sym_stats_from_stmt.
If the memory references memory, call
update_mem_sym_stats_from_stmt for all the direct memory
symbol references found.
(intra_create_variable_infos): Set noalias_state field for
pointer arguments according to the value of
flag_argument_noalias.
* tree-ssa-structalias.h (struct alias_info): Remove fields
num_calls_found and num_pure_const_calls_found.
(update_mem_sym_stats_from_stmt): Declare.
* params.def (PARAM_MAX_ALIASED_VOPS): Change description.
Set default value to 100.
(PARAM_AVG_ALIASED_VOPS): Define.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/doc/invoke.texi
trunk/gcc/fortran/options.c
trunk/gcc/opts.c
trunk/gcc/params.def
trunk/gcc/params.h
trunk/gcc/tree-dfa.c
trunk/gcc/tree-flow-inline.h
trunk/gcc/tree-flow.h
trunk/gcc/tree-ssa-alias.c
trunk/gcc/tree-ssa-copy.c
trunk/gcc/tree-ssa-operands.c
trunk/gcc/tree-ssa-operands.h
trunk/gcc/tree-ssa-structalias.c
trunk/gcc/tree-ssa-structalias.h
trunk/gcc/tree-ssa.c
trunk/gcc/tree-vrp.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30735
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/30735] [4.3 Regression] 50% slow down due to mem-ssa merge
2007-02-08 16:58 [Bug tree-optimization/30735] New: 50% slow down due to mem-ssa merge hjl at lucon dot org
` (7 preceding siblings ...)
2007-04-11 16:14 ` dnovillo at gcc dot gnu dot org
@ 2007-06-29 17:52 ` mmitchel at gcc dot gnu dot org
2007-06-29 17:57 ` hjl at lucon dot org
2007-11-10 17:07 ` rguenth at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-06-29 17:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from mmitchel at gcc dot gnu dot org 2007-06-29 17:52 -------
A patch has been checked in; can this be closed now?
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30735
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/30735] [4.3 Regression] 50% slow down due to mem-ssa merge
2007-02-08 16:58 [Bug tree-optimization/30735] New: 50% slow down due to mem-ssa merge hjl at lucon dot org
` (8 preceding siblings ...)
2007-06-29 17:52 ` mmitchel at gcc dot gnu dot org
@ 2007-06-29 17:57 ` hjl at lucon dot org
2007-11-10 17:07 ` rguenth at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: hjl at lucon dot org @ 2007-06-29 17:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from hjl at lucon dot org 2007-06-29 17:57 -------
(In reply to comment #7)
> A patch has been checked in; can this be closed now?
>
See
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31090#c16
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30735
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/30735] [4.3 Regression] 50% slow down due to mem-ssa merge
2007-02-08 16:58 [Bug tree-optimization/30735] New: 50% slow down due to mem-ssa merge hjl at lucon dot org
` (9 preceding siblings ...)
2007-06-29 17:57 ` hjl at lucon dot org
@ 2007-11-10 17:07 ` rguenth at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-11-10 17:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from rguenth at gcc dot gnu dot org 2007-11-10 17:07 -------
Likewise.
*** This bug has been marked as a duplicate of 33974 ***
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30735
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2007-11-10 17:07 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-08 16:58 [Bug tree-optimization/30735] New: 50% slow down due to mem-ssa merge hjl at lucon dot org
2007-02-08 17:01 ` [Bug tree-optimization/30735] " hjl at lucon dot org
2007-02-08 17:08 ` rguenth at gcc dot gnu dot org
2007-02-08 17:13 ` hjl at lucon dot org
2007-02-08 18:42 ` dnovillo at gcc dot gnu dot org
2007-02-13 0:59 ` dnovillo at gcc dot gnu dot org
2007-02-15 23:37 ` pthaugen at us dot ibm dot com
2007-03-07 0:44 ` [Bug tree-optimization/30735] [4.3 Regression] " pinskia at gcc dot gnu dot org
2007-04-11 16:14 ` dnovillo at gcc dot gnu dot org
2007-06-29 17:52 ` mmitchel at gcc dot gnu dot org
2007-06-29 17:57 ` hjl at lucon dot org
2007-11-10 17:07 ` 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).