From a8d8caca0cbfde0317ca96bfea75a7f047152dad Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 24 Jun 2020 08:08:00 +0200 Subject: 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. --- gcc/gimple-isel.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'gcc/gimple-isel.cc') 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 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::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 { -- cgit v1.1