This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Add DSE to early passes
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: Richard Guenther <rguenther at suse dot de>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 22 Apr 2015 05:13:11 -0700
- Subject: Re: Add DSE to early passes
- Authentication-results: sourceware.org; auth=none
- References: <20150413100117 dot GA61490 at kam dot mff dot cuni dot cz>
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.