public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][PR65893] Move pass_stdarg to after pass_dce in pass_all_optimizations
@ 2015-04-29  8:57 Tom de Vries
  2015-04-29  9:25 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2015-04-29  8:57 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]

Hi,

After moving the expansion of va_arg from gimplification to pass_stdarg, we 
execute less optimization passes on the expanded va_arg.

For example, in PR65893 the optimized-dump code for a va_arg expansion for 
aarch64 is less optimal than it was before, because pass_tree_ifcombine is no 
longer executed for the expanded va_arg.

This patch fixes the problem by moving pass_stdarg a bit earlier, to after pass_dce:
...
        NEXT_PASS (pass_vrp);
        NEXT_PASS (pass_chkp_opt);
        NEXT_PASS (pass_dce);
+      NEXT_PASS (pass_stdarg);
        NEXT_PASS (pass_call_cdce);
        NEXT_PASS (pass_cselim);
        NEXT_PASS (pass_copy_prop);
        NEXT_PASS (pass_tree_ifcombine);
        NEXT_PASS (pass_phiopt);
        NEXT_PASS (pass_tail_recursion);
        NEXT_PASS (pass_ch);
-      NEXT_PASS (pass_stdarg);
        NEXT_PASS (pass_lower_complex);
        NEXT_PASS (pass_sra);
        NEXT_PASS (pass_rename_ssa_copies);
...

Bootstrapped and reg-tested on x86_64.

OK for trunk?

Thanks,
- Tom

[-- Attachment #2: 0001-Move-pass_stdarg-to-after-pass_dce-in-pass_all_optim.patch --]
[-- Type: text/x-patch, Size: 1031 bytes --]

Move pass_stdarg to after pass_dce in pass_all_optimizations

2015-04-29  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/65893
	* passes.def (pass_all_optimizations): Move pass_stdarg to after
	pass_dce.
---
 gcc/passes.def | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/passes.def b/gcc/passes.def
index 6dce141..32213e8 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -172,6 +172,7 @@ along with GCC; see the file COPYING3.  If not see
       NEXT_PASS (pass_vrp);
       NEXT_PASS (pass_chkp_opt);
       NEXT_PASS (pass_dce);
+      NEXT_PASS (pass_stdarg);
       NEXT_PASS (pass_call_cdce);
       NEXT_PASS (pass_cselim);
       NEXT_PASS (pass_copy_prop);
@@ -179,7 +180,6 @@ along with GCC; see the file COPYING3.  If not see
       NEXT_PASS (pass_phiopt);
       NEXT_PASS (pass_tail_recursion);
       NEXT_PASS (pass_ch);
-      NEXT_PASS (pass_stdarg);
       NEXT_PASS (pass_lower_complex);
       NEXT_PASS (pass_sra);
       NEXT_PASS (pass_rename_ssa_copies);
-- 
1.9.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][PR65893] Move pass_stdarg to after pass_dce in pass_all_optimizations
  2015-04-29  8:57 [PATCH][PR65893] Move pass_stdarg to after pass_dce in pass_all_optimizations Tom de Vries
@ 2015-04-29  9:25 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2015-04-29  9:25 UTC (permalink / raw)
  To: Tom de Vries; +Cc: GCC Patches

On Wed, Apr 29, 2015 at 10:52 AM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> Hi,
>
> After moving the expansion of va_arg from gimplification to pass_stdarg, we
> execute less optimization passes on the expanded va_arg.
>
> For example, in PR65893 the optimized-dump code for a va_arg expansion for
> aarch64 is less optimal than it was before, because pass_tree_ifcombine is
> no longer executed for the expanded va_arg.
>
> This patch fixes the problem by moving pass_stdarg a bit earlier, to after
> pass_dce:
> ...
>        NEXT_PASS (pass_vrp);
>        NEXT_PASS (pass_chkp_opt);
>        NEXT_PASS (pass_dce);
> +      NEXT_PASS (pass_stdarg);
>        NEXT_PASS (pass_call_cdce);
>        NEXT_PASS (pass_cselim);
>        NEXT_PASS (pass_copy_prop);
>        NEXT_PASS (pass_tree_ifcombine);
>        NEXT_PASS (pass_phiopt);
>        NEXT_PASS (pass_tail_recursion);
>        NEXT_PASS (pass_ch);
> -      NEXT_PASS (pass_stdarg);
>        NEXT_PASS (pass_lower_complex);
>        NEXT_PASS (pass_sra);
>        NEXT_PASS (pass_rename_ssa_copies);
> ...
>
> Bootstrapped and reg-tested on x86_64.
>
> OK for trunk?

Ok.

Thanks,
Richard.

> Thanks,
> - Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-29  9:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-29  8:57 [PATCH][PR65893] Move pass_stdarg to after pass_dce in pass_all_optimizations Tom de Vries
2015-04-29  9:25 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).