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: Add DSE to early passes


On Mon, Apr 13, 2015 at 3:01 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> this patch adds DSE to early optimizations and handles testuiste fallout.
> As discussed in PR 65076 this reduces number of CLOBBER statements in tramp3d
> to 50% (and those accounts 29% of all code previously). The pass also quite
> often kills real stores reducing Firefox binary by over 2% due to
> better inline decisions.
>
> Bootstrapped/regtested ppc64-linux, OK?
>
> Honza
>
>         * passes.def (early_optimizations): Add pass_dse.
>
>         * g++.dg/tree-ssa/pr61034.C: Update template.
>         * g++.dg/warn/Warray-bounds.C: Harden for DSE.
>         * gcc.dg/Warray-bounds-11.c: Likewise.
>         * gcc.dg/Warray-bounds.c: Likewise.
> Index: passes.def
> ===================================================================
> --- passes.def  (revision 222016)
> +++ passes.def  (working copy)
> @@ -89,6 +89,7 @@ along with GCC; see the file COPYING3.
>           NEXT_PASS (pass_build_ealias);
>           NEXT_PASS (pass_fre);
>           NEXT_PASS (pass_merge_phi);
> +          NEXT_PASS (pass_dse);
>           NEXT_PASS (pass_cd_dce);
>           NEXT_PASS (pass_early_ipa_sra);
>           NEXT_PASS (pass_tail_recursion);
> Index: testsuite/g++.dg/tree-ssa/pr61034.C
> ===================================================================
> --- testsuite/g++.dg/tree-ssa/pr61034.C (revision 222016)
> +++ testsuite/g++.dg/tree-ssa/pr61034.C (working copy)
> @@ -42,6 +42,6 @@ bool f(I a, I b, I c, I d) {
>  // This works only if everything is inlined into 'f'.
>
>  // { dg-final { scan-tree-dump-times ";; Function" 1 "fre2" } }
> -// { dg-final { scan-tree-dump-times "free" 19 "fre2" } }
> +// { dg-final { scan-tree-dump-times "free" 18 "fre2" } }
>  // { dg-final { scan-tree-dump-times "unreachable" 11 "fre2" } }
>  // { dg-final { cleanup-tree-dump "fre2" } }

I got

FAIL: g++.dg/tree-ssa/pr61034.C  -std=gnu++11  scan-tree-dump-times
fre2 "free" 18
FAIL: g++.dg/tree-ssa/pr61034.C  -std=gnu++14  scan-tree-dump-times
fre2 "free" 18
FAIL: g++.dg/tree-ssa/pr61034.C  -std=gnu++98  scan-tree-dump-times
fre2 "free" 18

on Linux/x86.


-- 
H.J.


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