This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Update passes to use optimize_*_for_size_p tests
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Richard Guenther <richard dot guenther at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 28 Apr 2010 18:24:03 -0700
- Subject: Re: Update passes to use optimize_*_for_size_p tests
- References: <20080828233052.GD2535@kam.mff.cuni.cz> <84fc9c000808290113s4e5b5007vc1b13e854e410919@mail.gmail.com> <20080829090159.GF2535@kam.mff.cuni.cz>
On Fri, Aug 29, 2008 at 2:01 AM, Jan Hubicka <jh@suse.cz> wrote:
>> On Fri, Aug 29, 2008 at 1:30 AM, Jan Hubicka <jh@suse.cz> wrote:
>> > Hi,
>> > this patch updates current tests for optimize_size and maybe_hot_bb* for
>> > optimize*_for_size_p. ?I've also added optimize_loop_for_size_p as there seems
>> > to be some confussion in loop optimizer on how to identify loops to be
>> > optimized aggressivly and removed from opts.c code disabling passes on
>> > optimize_size that now can work that out from profile.
>> >
>> > Bootstrapped/regtested i686-linux, will commit it tomorrow if there are no complains.
>> >
>> ===================================================================
>> > *** loop-unswitch.c ? ? (revision 139737)
>> > --- loop-unswitch.c ? ? (working copy)
>> > *************** unswitch_single_loop (struct loop *loop,
>> > *** 290,296 ****
>> > ? ? ?}
>> >
>> > ? ?/* Do not unswitch in cold areas. ?*/
>> > ! ? if (!maybe_hot_bb_p (loop->header))
>> > ? ? ?{
>> > ? ? ? ?if (dump_file)
>> > ? ? ? ?fprintf (dump_file, ";; Not unswitching, not hot area\n");
>> > --- 290,296 ----
>> > ? ? ?}
>> >
>> > ? ?/* Do not unswitch in cold areas. ?*/
>> > ! ? if (optimize_loop_for_speed_p (loop))
>>
>> The change looks backward.
>
> Indeed it is. ?I am always trying to double check the changes, but
> missed this one, thanks!
>>
>>
>>
>> > *** tree-ssa-loop-ch.c ?(revision 139737)
>> > --- tree-ssa-loop-ch.c ?(working copy)
>> > *************** should_duplicate_loop_header_p (basic_bl
>> > *** 58,63 ****
>> > --- 58,70 ----
>> > ? ?if (header->aux)
>> > ? ? ?return false;
>> >
>> > + ? /* Loop header copying usually increases size of the code. ?This used not to
>> > + ? ? ?be true, since quite often it is possible to verify that the condition is
>> > + ? ? ?satisfied in the first iteration and therefore to eliminate it. ?Jump
>> > + ? ? ?threading handles these cases now. ?*/
>> > + ? if (optimize_loop_for_size_p (loop))
>> > + ? ? return false;
>> > +
>>
>> It would be nice to do this change separately.
>
> OK, I've comitted this hunk now and re-testing the overall patch.
>
> Thanks!
>
> Index: ChangeLog
> ===================================================================
> *** ChangeLog ? (revision 139755)
> --- ChangeLog ? (working copy)
> ***************
> *** 1,5 ****
> --- 1,16 ----
> ?2008-08-29 ?Jan Hubicka ?<jh@suse.cz>
>
> + ? ? ? * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Check that loop
> + ? ? ? is not cold.
> + ? ? ? * predict.c (optimize_bb_for_size_p, optimize_bb_for_speed_p):
> + ? ? ? Constify arguments.
> + ? ? ? (optimize_loop_for_size_p, optimize_loop_for_speed_p): New functions.
> + ? ? ? * basic-block.h (optimize_bb_for_size_p, optimize_bb_for_speed_p):
> + ? ? ? Constify.
> + ? ? ? (optimize_loop_for_size_p, optimize_loop_for_speed_p): Declare.
> +
> + 2008-08-29 ?Jan Hubicka ?<jh@suse.cz>
> +
This patch caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43884
--
H.J.