Make flag_thread_jumps a gate of pass_jump_after_combine
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 14 Nov 2019 16:40:33 +0000 (16:40 +0000)
committerIlya Leoshkevich <iii@gcc.gnu.org>
Thu, 14 Nov 2019 16:40:33 +0000 (16:40 +0000)
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-14  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.

From-SVN: r278254

gcc/ChangeLog
gcc/cfgcleanup.c

index 7140f5acc1d98a9cd48fc9eaa7e61c7d7a7fb1de..051b10ed953c459715f500dc0e93572a88853468 100644 (file)
@@ -1,3 +1,10 @@
+2019-11-14  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.
+
 2019-11-14  Jerome Lambourg  <lambourg@adacore.com>
            Doug Rupp <rupp@adacore.com>
            Olivier Hainque  <hainque@adacore.com>
index 7f388258e10cd0c7f3d73d72d5a5e5c9877b05a3..f1d421b1cfa91c4f54fd8b745f14498c25bbb12e 100644 (file)
@@ -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;
 }