On 7/22/10 3:34 AM, Steven Bosscher wrote:
On Wed, Jul 21, 2010 at 10:09 PM, Maxim Kuvyrkov<ma...@codesourcery.com> wrote:
Cselib can /always/ be used during second scheduling pass
Except with the selective scheduler when it works on regions that are
not extended basic blocks, I suppose?
Right, I was considering sched-rgn scheduler, not sel-sched.
and on
single-block regions during the first scheduling pass (after RA sched-rgn
operates on single-block regions).
Modulo the bugs enabling cselib might surface, the only reason not to enable
cselib for single-block regions in sched-rgn may be increased compile time.
That requires some benchmarking, but my gut feeling is that the benefits
would outweigh the compile-time cost.
So something like the following _should_ work? If so, I'll give it a
try on x86*.
Ciao!
Steven
Index: sched-rgn.c
===================================================================
--- sched-rgn.c (revision 162355)
+++ sched-rgn.c (working copy)
@@ -3285,8 +3285,11 @@
rgn_setup_sched_infos (void)
{
if (!sel_sched_p ())
- memcpy (&rgn_sched_deps_info,&rgn_const_sched_deps_info,
- sizeof (rgn_sched_deps_info));
+ {
+ memcpy (&rgn_sched_deps_info,&rgn_const_sched_deps_info,
+ sizeof (rgn_sched_deps_info));
+ rgn_sched_deps_info.use_cselib = reload_completed;
Yes, this should work. You can also enable cselib for single-block
regions for first scheduling pass too. I.e.,
index 89743c3..047b717 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -2935,6 +2935,9 @@ schedule_region (int rgn)
if (sched_is_disabled_for_current_region_p ())
return;
+ gcc_assert (!reload_completed || current_nr_blocks == 1);
+ rgn_sched_deps_info.use_cselib = (current_nr_blocks == 1);
+
sched_rgn_compute_dependencies (rgn);
sched_rgn_local_init (rgn);
Thanks,
--
Maxim Kuvyrkov
CodeSourcery
ma...@codesourcery.com
(650) 331-3385 x724