This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Improving jump-thread pass for PR 54742
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Steve Ellcey <sellcey at mips dot com>
- Cc: Sebastian Pop <sebpop at gmail dot com>, Jeff Law <law at redhat dot com>, James Greenhalgh <james dot greenhalgh at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 9 Dec 2014 14:14:15 +0100
- Subject: Re: [Patch] Improving jump-thread pass for PR 54742
- Authentication-results: sourceware.org; auth=none
- References: <20141125010927 dot GA30407 at f1 dot c dot bardezibar dot internal> <54740BD2 dot 3080206 at redhat dot com> <5474AB10 dot 7040809 at redhat dot com> <20141125172945 dot GA31146 at f1 dot c dot bardezibar dot internal> <20141125211618 dot GA32340 at f1 dot c dot bardezibar dot internal> <547CD855 dot 50501 at redhat dot com> <20141204110428 dot GC18834 at f1 dot c dot bardezibar dot internal> <20141204142956 dot GD18834 at f1 dot c dot bardezibar dot internal> <548211B9 dot 6020307 at redhat dot com> <20141206134728 dot GA29926 at f1 dot c dot bardezibar dot internal> <20141206192113 dot GB29926 at f1 dot c dot bardezibar dot internal> <1418075397 dot 2196 dot 76 dot camel at ubuntu-sellcey>
On Mon, Dec 8, 2014 at 10:49 PM, Steve Ellcey <sellcey@mips.com> wrote:
> On Sat, 2014-12-06 at 19:21 +0000, Sebastian Pop wrote:
>
>> > I think it does not make sense to duplicate paths at -Os: I disabled the FSM
>> > jump-threading when optimizing for size like this.
>> >
>> > diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
>> > index 29b20c8..ce70311 100644
>> > --- a/gcc/tree-ssa-threadedge.c
>> > +++ b/gcc/tree-ssa-threadedge.c
>> > @@ -1335,8 +1335,9 @@ thread_through_normal_block (edge e,
>> > return 1;
>> > }
>> >
>> > if (!flag_expensive_optimizations
>> > + || optimize_function_for_size_p (cfun)
>> > || TREE_CODE (cond) != SSA_NAME
>> > || e->dest->loop_father != e->src->loop_father
>> > || loop_depth (e->dest->loop_father) == 0)
>> > return 0;
>> >
>> > I will regstrap and commit the attached patch.
>>
>> Bootstrapped and regression tested on x86_64-linux.
>> Committed r218451.
>>
>> Sebastian
>
> Thanks for getting all this checked in Sebastian, I have tested it on
> coremark and I am getting the speed up that I expect. But I am a little
> confused about turning off jump threading. I am getting the
> optimization on coremark with -O3 and that is great and if I use '-O3
> -fno-expensive-optimizations' then I don't see this part of the jump
> threading, also great. But I was surprised that if I just used '-O3
> -fno-thread-jumps' then I still see this optimization. Is that
> expected? Should this test also check flag_thread_jumps? Or should
> that be getting checked somewhere else?
-fthread-jumps is an RTL optimization flag and ignored on GIMPLE.
Richard.
> Steve Ellcey
>
>