]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Avoid CFG updates in VRP threader if nothing changed.
authorAldy Hernandez <aldyh@redhat.com>
Wed, 29 Sep 2021 08:02:12 +0000 (10:02 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Wed, 29 Sep 2021 18:27:53 +0000 (20:27 +0200)
There is no need to update the CFG or SSAs if nothing has changed in VRP
threading.

gcc/ChangeLog:

* tree-vrp.c (thread_through_all_blocks): Return bool.
(execute_vrp_threader): Return TODO_* flags.
(pass_data_vrp_threader): Set todo_flags_finish to 0.

gcc/tree-vrp.c

index db9f3cd0a2f94ac48ef5ec172702c7377a5d10ed..69a3ab0ea9d59aa78f69358d1f874e660149e815 100644 (file)
@@ -4372,9 +4372,9 @@ public:
   {
     walk (fun->cfg->x_entry_block_ptr);
   }
-  void thread_through_all_blocks ()
+  bool thread_through_all_blocks ()
   {
-    m_threader->thread_through_all_blocks (false);
+    return m_threader->thread_through_all_blocks (false);
   }
 
 private:
@@ -4438,7 +4438,8 @@ execute_vrp_threader (function *fun)
 {
   hybrid_threader threader;
   threader.thread_jumps (fun);
-  threader.thread_through_all_blocks ();
+  if (threader.thread_through_all_blocks ())
+    return (TODO_cleanup_cfg | TODO_update_ssa);
   return 0;
 }
 
@@ -4454,7 +4455,7 @@ const pass_data pass_data_vrp_threader =
   0, /* properties_provided */
   0, /* properties_destroyed */
   0, /* todo_flags_start */
-  ( TODO_cleanup_cfg | TODO_update_ssa ), /* todo_flags_finish */
+  0 /* todo_flags_finish */
 };
 
 class pass_vrp_threader : public gimple_opt_pass