This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR42621, "Computed gotos on AMD 800% slower"
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 8 Jan 2010 13:03:58 +0100
- Subject: Re: [patch] Fix PR42621, "Computed gotos on AMD 800% slower"
- References: <571f6b511001070958x6cda2b50y8e46b668621d7898@mail.gmail.com>
On Thu, Jan 7, 2010 at 6:58 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> Hello,
>
> Attached patch fixes PR42621 by going back to the state of things from
> before GCC 4.4. Unfactoring computed gotos based on whether we are
> optimizing a basic block for speed or size doesn't really make no
> sense, especially if we have to work with a guessed profile.
>
> Bootstrapped+tested on {ia64,x86_64}-unknown-linux-gnu. OK?
Ok.
Thanks,
Richard.
> Ciao!
> Steven
>
>
>
>
> ? ? ? ?PR rtl-optimization/42621
> ? ? ? ?* bb-reorder.c (gate_duplicated_computed_gotos): Only run if not
> ? ? ? ?optimizing for size.
> ? ? ? ?(duplicate_computed_gotos): Remove now-redundant check.
>
> Index: bb-reorder.c
> ===================================================================
> --- bb-reorder.c ? ? ? ?(revision 155697)
> +++ bb-reorder.c ? ? ? ?(working copy)
> @@ -1981,7 +1981,9 @@ gate_duplicate_computed_gotos (void)
> ?{
> ? if (targetm.cannot_modify_jumps_p ())
> ? ? return false;
> - ?return (optimize > 0 && flag_expensive_optimizations);
> + ?return (optimize > 0
> + ? ? ? ? && flag_expensive_optimizations
> + ? ? ? ? && ! optimize_function_for_size_p (cfun));
> ?}
>
>
> @@ -2072,9 +2074,6 @@ duplicate_computed_gotos (void)
> ? ? ? ? ?|| single_pred_p (single_succ (bb)))
> ? ? ? ?continue;
>
> - ? ? ?if (!optimize_bb_for_size_p (bb))
> - ? ? ? continue;
> -
> ? ? ? /* The successor block has to be a duplication candidate. ?*/
> ? ? ? if (!bitmap_bit_p (candidates, single_succ (bb)->index))
> ? ? ? ?continue;
>