This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Switch elimination pass for PR 54742


On Tue, Aug 19, 2014 at 10:39 PM, Steve Ellcey <sellcey@mips.com> wrote:
> Here is an official submission for the switch optimization described in
> PR 54742.  I have addressed the formatting/comment issues that were raised
> and also added a test case based on comment #27 from PR 54742 and I fixed a
> bug I found while doing benchmarking with SPEC2006 (the perl benchmark was
> generating an ICE in a routine with multiple switch statements).
>
> I ran the benchmarking to see if I could find any more tests that are
> helped like coremark is and while I found a number of benchmarks in
> SPEC 2006 and EEMBC where the optimization is triggered, this optimization
> generally didn't affect the performance of those benchmarks.  The biggest
> impact I could find was on the perl benchmark in SPEC where I saw around
> a 0.4% improvement on a MIPS 74k.  Not huge, but not nothing.
>
> So, OK to checkin?

Without looking at the patch in detail what is the rationale for the
pass placement (looks quite early)?  I would have guessed that
the pass could benefit from value-range analysis.

Jeff, Steve is it possible to trigger the transform by simply
"manually forcing" the right "path" jump-threads from
inside VRP?  That is, basically integrate the transform part
with the existing jump threading framework but do an
alternate discovery pass?

Thanks,
Richard.

> Steve Ellcey
> sellcey@mips.com
>
>
> 2014-08-12  Steve Ellcey  <sellcey@mips.com>
>
>         PR tree-opt/54742
>         * Makefile.in (OBJS): Add tree-switch-shortcut.o.
>         * common.opt (ftree-switch-shortcut): New.
>         * opts.c (default_options_table): Add OPT_ftree_switch_shortcut.
>         * params.def (PARAM_MAX_SWITCH_INSNS): New.
>         (PARAM_MAX_SWITCH_PATHS): New.
>         * passes.def (pass_tree_switch_shortcut): New.
>         * timevar.def (TV_TREE_SWITCH_SHORTCUT): New.
>         * tree-pass.h (make_pass_tree_switch_shortcut): New.
>         * tree-switch-shortcut.c: New.
>
>
> 2014-08-12  Steve Ellcey  <sellcey@mips.com>
>
>         PR tree-opt/54742
>         * gcc.dg/pr54742.c: New test.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]