aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-isel.cc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-06-24 08:08:00 +0200
committerMartin Liska <mliska@suse.cz>2020-06-25 08:57:47 +0200
commita8d8caca0cbfde0317ca96bfea75a7f047152dad (patch)
tree8f446411e050a36151bb9f30d61e0d8e1d1c088d /gcc/gimple-isel.cc
parent2e546c261beddd649e92925373e1c54aec3299a0 (diff)
downloadgcc-a8d8caca0cbfde0317ca96bfea75a7f047152dad.zip
gcc-a8d8caca0cbfde0317ca96bfea75a7f047152dad.tar.gz
gcc-a8d8caca0cbfde0317ca96bfea75a7f047152dad.tar.bz2
VEC_COND_EXPR: clean up first argument
gcc/ChangeLog: PR tree-optimization/95745 PR middle-end/95830 * gimple-isel.cc (gimple_expand_vec_cond_exprs): Delete dead SSA_NAMEs used as the first argument of a VEC_COND_EXPR. Always return 0. * tree-vect-generic.c (expand_vector_condition): Remove dead SSA_NAMEs used as the first argument of a VEC_COND_EXPR.
Diffstat (limited to 'gcc/gimple-isel.cc')
-rw-r--r--gcc/gimple-isel.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/gimple-isel.cc b/gcc/gimple-isel.cc
index 97f9208..b330cf4 100644
--- a/gcc/gimple-isel.cc
+++ b/gcc/gimple-isel.cc
@@ -33,6 +33,8 @@ along with GCC; see the file COPYING3. If not see
#include "gimplify-me.h"
#include "gimplify.h"
#include "tree-cfg.h"
+#include "bitmap.h"
+#include "tree-ssa-dce.h"
/* Expand all VEC_COND_EXPR gimple assignments into calls to internal
function based on type of selected expansion. */
@@ -178,8 +180,8 @@ gimple_expand_vec_cond_exprs (void)
{
gimple_stmt_iterator gsi;
basic_block bb;
- bool cfg_changed = false;
hash_map<tree, unsigned int> vec_cond_ssa_name_uses;
+ auto_bitmap dce_ssa_names;
FOR_EACH_BB_FN (bb, cfun)
{
@@ -196,7 +198,13 @@ gimple_expand_vec_cond_exprs (void)
}
}
- return cfg_changed ? TODO_cleanup_cfg : 0;
+ for (hash_map<tree, unsigned int>::iterator it = vec_cond_ssa_name_uses.begin ();
+ it != vec_cond_ssa_name_uses.end (); ++it)
+ bitmap_set_bit (dce_ssa_names, SSA_NAME_VERSION ((*it).first));
+
+ simple_dce_from_worklist (dce_ssa_names);
+
+ return 0;
}
namespace {