From: Aldy Hernandez Date: Wed, 29 Sep 2021 08:02:12 +0000 (+0200) Subject: Avoid CFG updates in VRP threader if nothing changed. X-Git-Tag: basepoints/gcc-13~4344 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77731cb8f3cfd2cc94219e03e7521822d679c6a4;p=thirdparty%2Fgcc.git Avoid CFG updates in VRP threader if nothing changed. 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. --- diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index db9f3cd0a2f9..69a3ab0ea9d5 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -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