#include "case-cfn-macros.h"
#include "builtins.h"
#include "optabs-tree.h"
+#include "tree-ssa-dce.h"
/* For each complex ssa name, a lattice value. We're interested in finding
out whether a complex number is degenerate in some way, having only real
/* BBs that need EH cleanup. */
static bitmap need_eh_cleanup;
+/* SSA defs we should try to DCE. */
+static bitmap dce_worklist;
+
/* Lookup UID in the complex_variable_components hashtable and return the
associated tree. */
static tree
update_stmt (stmt);
if (maybe_clean_or_replace_eh_stmt (old_stmt, stmt))
bitmap_set_bit (need_eh_cleanup, gimple_bb (stmt)->index);
+ bitmap_set_bit (dce_worklist, SSA_NAME_VERSION (gimple_assign_lhs (stmt)));
update_complex_components (gsi, gsi_stmt (*gsi), r, i);
}
complex_propagate.ssa_propagate ();
need_eh_cleanup = BITMAP_ALLOC (NULL);
+ dce_worklist = BITMAP_ALLOC (NULL);
complex_variable_components = new int_tree_htab_type (10);
gsi_commit_edge_inserts ();
+ simple_dce_from_worklist (dce_worklist, need_eh_cleanup);
+ BITMAP_FREE (dce_worklist);
+
unsigned todo
= gimple_purge_all_dead_eh_edges (need_eh_cleanup) ? TODO_cleanup_cfg : 0;
BITMAP_FREE (need_eh_cleanup);