aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2018-07-31 14:26:18 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-07-31 14:26:18 +0000
commitb5b56c2a039cd308a9d00fc35baf65c1fb59070b (patch)
treec5d6d08e6e4b53af6d0690bfd84301ec152bd335 /gcc/tree-vectorizer.c
parentf5ae28565e7b0788c6b7a4945c2b67c54f46c45a (diff)
downloadgcc-b5b56c2a039cd308a9d00fc35baf65c1fb59070b.zip
gcc-b5b56c2a039cd308a9d00fc35baf65c1fb59070b.tar.gz
gcc-b5b56c2a039cd308a9d00fc35baf65c1fb59070b.tar.bz2
[41/46] Add vec_info::remove_stmt
This patch adds a new helper function for permanently removing a statement and its associated stmt_vec_info. 2018-07-31 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vectorizer.h (vec_info::remove_stmt): Declare. * tree-vectorizer.c (vec_info::remove_stmt): New function. * tree-vect-loop-manip.c (vect_set_loop_condition): Use it. * tree-vect-loop.c (vect_transform_loop): Likewise. * tree-vect-slp.c (vect_schedule_slp): Likewise. * tree-vect-stmts.c (vect_remove_stores): Likewise. From-SVN: r263156
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r--gcc/tree-vectorizer.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index cece978..abdc6cd 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -588,6 +588,20 @@ vec_info::move_dr (stmt_vec_info new_stmt_info, stmt_vec_info old_stmt_info)
= STMT_VINFO_GATHER_SCATTER_P (old_stmt_info);
}
+/* Permanently remove the statement described by STMT_INFO from the
+ function. */
+
+void
+vec_info::remove_stmt (stmt_vec_info stmt_info)
+{
+ gcc_assert (!stmt_info->pattern_stmt_p);
+ gimple_stmt_iterator si = gsi_for_stmt (stmt_info->stmt);
+ unlink_stmt_vdef (stmt_info->stmt);
+ gsi_remove (&si, true);
+ release_defs (stmt_info->stmt);
+ free_stmt_vec_info (stmt_info);
+}
+
/* A helper function to free scev and LOOP niter information, as well as
clear loop constraint LOOP_C_FINITE. */