diff mbox series

Make flag_thread_jumps a gate of pass_jump_after_combine

Message ID 20191114092920.49882-1-iii@linux.ibm.com
State New
Headers show
Series Make flag_thread_jumps a gate of pass_jump_after_combine | expand

Commit Message

Ilya Leoshkevich Nov. 14, 2019, 9:29 a.m. UTC
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  <iii@linux.ibm.com>

	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(-)

Comments

Richard Biener Nov. 14, 2019, 10:12 a.m. UTC | #1
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  <iii@linux.ibm.com>
> 
> 	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;
>  }
>  
>
diff mbox series

Patch

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;
 }