[PATCH] Make flag_thread_jumps a gate of pass_jump_after_combine

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Make flag_thread_jumps a gate of pass_jump_after_combine

Ilya Leoshkevich
Bootstrapped and regtested on x86_64-redhat-linux, s390x-redhat-linux and
ppc64le-redhat-linux.  OK for trunk and gcc-9-branch?  I'd like to commit
this and https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00919.html together
to gcc-9-branch.


This is a follow-up to
https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00919.html (r278095).
Dominance info is deleted even if we don't perform jump threading. Since
the whole point of this pass is to perform jump threading (other
cleanups are not valuable at this point), skip it completely when
flag_thread_jumps is not set.

gcc/ChangeLog:

2019-11-13  Ilya Leoshkevich  <[hidden email]>

        PR rtl-optimization/92430
        * cfgcleanup.c (pass_jump_after_combine::gate): New function.
        (pass_jump_after_combine::execute): Perform jump threading
        unconditionally.
---
 gcc/cfgcleanup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 7f388258e10..f1d421b1cfa 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -3304,6 +3304,7 @@ public:
   {}
 
   /* opt_pass methods: */
+  virtual bool gate (function *) { return flag_thread_jumps; }
   virtual unsigned int execute (function *);
 
 }; // class pass_jump_after_combine
@@ -3313,7 +3314,7 @@ pass_jump_after_combine::execute (function *)
 {
   /* Jump threading does not keep dominators up-to-date.  */
   free_dominance_info (CDI_DOMINATORS);
-  cleanup_cfg (flag_thread_jumps ? CLEANUP_THREADING : 0);
+  cleanup_cfg (CLEANUP_THREADING);
   return 0;
 }
 
--
2.23.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Make flag_thread_jumps a gate of pass_jump_after_combine

Richard Biener
On Thu, 14 Nov 2019, Ilya Leoshkevich wrote:

> Bootstrapped and regtested on x86_64-redhat-linux, s390x-redhat-linux and
> ppc64le-redhat-linux.  OK for trunk and gcc-9-branch?  I'd like to commit
> this and https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00919.html together
> to gcc-9-branch.

OK.

Richard.

>
> This is a follow-up to
> https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00919.html (r278095).
> Dominance info is deleted even if we don't perform jump threading. Since
> the whole point of this pass is to perform jump threading (other
> cleanups are not valuable at this point), skip it completely when
> flag_thread_jumps is not set.
>
> gcc/ChangeLog:
>
> 2019-11-13  Ilya Leoshkevich  <[hidden email]>
>
> PR rtl-optimization/92430
> * cfgcleanup.c (pass_jump_after_combine::gate): New function.
> (pass_jump_after_combine::execute): Perform jump threading
> unconditionally.
> ---
>  gcc/cfgcleanup.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
> index 7f388258e10..f1d421b1cfa 100644
> --- a/gcc/cfgcleanup.c
> +++ b/gcc/cfgcleanup.c
> @@ -3304,6 +3304,7 @@ public:
>    {}
>  
>    /* opt_pass methods: */
> +  virtual bool gate (function *) { return flag_thread_jumps; }
>    virtual unsigned int execute (function *);
>  
>  }; // class pass_jump_after_combine
> @@ -3313,7 +3314,7 @@ pass_jump_after_combine::execute (function *)
>  {
>    /* Jump threading does not keep dominators up-to-date.  */
>    free_dominance_info (CDI_DOMINATORS);
> -  cleanup_cfg (flag_thread_jumps ? CLEANUP_THREADING : 0);
> +  cleanup_cfg (CLEANUP_THREADING);
>    return 0;
>  }
>  
>
--
Richard Biener <[hidden email]>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)