aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2021-09-29 10:02:12 +0200
committerAldy Hernandez <aldyh@redhat.com>2021-09-29 20:27:53 +0200
commit77731cb8f3cfd2cc94219e03e7521822d679c6a4 (patch)
tree178fa282ca92ae90aac150f1736d32c3c67dc251 /gcc/tree-vrp.c
parent48c97c62c90eedfadd41793f438ed4187df65fd7 (diff)
downloadgcc-77731cb8f3cfd2cc94219e03e7521822d679c6a4.zip
gcc-77731cb8f3cfd2cc94219e03e7521822d679c6a4.tar.gz
gcc-77731cb8f3cfd2cc94219e03e7521822d679c6a4.tar.bz2
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.
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index db9f3cd..69a3ab0 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