diff options
author | amonakov <amonakov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-08 11:49:43 +0000 |
---|---|---|
committer | amonakov <amonakov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-08 11:49:43 +0000 |
commit | a8d6ade370f2755c35c18aeaa9a713c1beb6a6a8 (patch) | |
tree | b24f6232438679f7da43611698b485f6401bd044 /gcc | |
parent | def66588c41e326621bee54f4ca6d22d616b1b48 (diff) | |
download | gcc-a8d6ade370f2755c35c18aeaa9a713c1beb6a6a8.tar.gz |
PR target/48273
* cfgloop.h (loop_has_exit_edges): New helper.
* sel-sched-ir.c (init_global_and_expr_for_insn): Make CALLs
non-clonable.
* sel-sched.c (sel_setup_region_sched_flags): Don't pipeline loops
that have no exit edges.
testsuite:
* g++.dg/opt/pr48273.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172175 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cfgloop.h | 8 | ||||
-rw-r--r-- | gcc/sel-sched-ir.c | 1 | ||||
-rw-r--r-- | gcc/sel-sched.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/opt/pr48273.C | 10 |
6 files changed, 35 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b357ba76939..523c3b704cf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ 2011-04-08 Alexander Monakov <amonakov@ispras.ru> + PR target/48273 + * cfgloop.h (loop_has_exit_edges): New helper. + * sel-sched-ir.c (init_global_and_expr_for_insn): Make CALLs + non-clonable. + * sel-sched.c (sel_setup_region_sched_flags): Don't pipeline loops + that have no exit edges. + +2011-04-08 Alexander Monakov <amonakov@ispras.ru> + PR rtl-optimization/48442 * sel-sched.c (init_seqno): Remove number_of_insns argument. Update all callers. Adjust assert. diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index f7bb1341a63..0ff44de67d3 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -443,6 +443,14 @@ loop_outer (const struct loop *loop) return VEC_index (loop_p, loop->superloops, n - 1); } +/* Returns true if LOOP has at least one exit edge. */ + +static inline bool +loop_has_exit_edges (const struct loop *loop) +{ + return loop->exits->next->e != NULL; +} + /* Returns the list of loops in current_loops. */ static inline VEC (loop_p, gc) * diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index 67484dd77d9..95c1431001e 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -2905,6 +2905,7 @@ init_global_and_expr_for_insn (insn_t insn) if (CANT_MOVE (insn) || INSN_ASM_P (insn) || SCHED_GROUP_P (insn) + || CALL_P (insn) /* Exception handling insns are always unique. */ || (cfun->can_throw_non_call_exceptions && can_throw_internal (insn)) /* TRAP_IF though have an INSN code is control_flow_insn_p (). */ diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 0e8173b3ddd..fb1a026bf28 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -6781,7 +6781,8 @@ sel_setup_region_sched_flags (void) bookkeeping_p = 1; pipelining_p = (bookkeeping_p && (flag_sel_sched_pipelining != 0) - && current_loop_nest != NULL); + && current_loop_nest != NULL + && loop_has_exit_edges (current_loop_nest)); max_insns_to_rename = PARAM_VALUE (PARAM_SELSCHED_INSNS_TO_RENAME); max_ws = MAX_WS; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e311e804439..96c224fcfec 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2011-04-08 Alexander Monakov <amonakov@ispras.ru> + PR target/48273 + * g++.dg/opt/pr48273.C: New. + +2011-04-08 Alexander Monakov <amonakov@ispras.ru> + PR rtl-optimization/48442 * gcc.dg/pr48442.c: New. diff --git a/gcc/testsuite/g++.dg/opt/pr48273.C b/gcc/testsuite/g++.dg/opt/pr48273.C new file mode 100644 index 00000000000..4c5108bdd26 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr48273.C @@ -0,0 +1,10 @@ +// { dg-do compile { target x86_64-*-* } } +// { dg-options "-fschedule-insns2 -fsel-sched-pipelining -fselective-scheduling2 -funroll-all-loops -march=core2" } + +void bar (); + +void foo () +{ + for (;;) + bar (); +} |