|
GCC Middle and Back End API Reference
|

Go to the source code of this file.
Functions | |
| void | simple_dce_from_worklist (bitmap, bitmap=nullptr, bool no_delete=false) |
Copyright (C) 2017-2026 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
A cheap DCE interface. WORKLIST is a list of possibly dead stmts and is consumed by this function. The function has linear complexity in the number of dead stmts with a constant factor like the average SSA use operands number. If no_delete is true (defaults to false) then rather than deleting the statement, it is replaced with an assignment to 0. This allows the same elimination of statement dependencies, but delays the actual statement removal from the IL until the next time DCE is run and they are detected as dead statements with no uses.
References as_a(), bitmap_clear_first_set_bit(), bitmap_empty_p(), bitmap_set_bit, build_zero_cst(), cfun, dump_file, dump_flags, dyn_cast(), FOR_EACH_IMM_USE_FAST, FOR_EACH_PHI_OR_STMT_USE, gimple_bb(), gimple_build_assign(), gimple_call_set_lhs(), gimple_has_side_effects(), gimple_phi_num_args(), gsi_for_stmt(), gsi_remove(), gsi_replace(), has_zero_uses(), i, is_a(), is_gimple_debug(), need_eh_cleanup, NULL_TREE, print_gimple_stmt(), release_defs(), release_ssa_name(), remove_phi_node(), reset_flow_sensitive_info(), SET_PHI_ARG_DEF, single_ssa_def_operand(), ssa_name, SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VERSION, SSA_OP_ALL_DEFS, SSA_OP_USE, statistics_counter_event(), stmt_could_throw_p(), stmt_unremovable_because_of_non_call_eh_p(), TDF_DETAILS, TREE_CODE, TREE_TYPE, unlink_stmt_vdef(), update_stmt(), USE_FROM_PTR, USE_STMT, and worklist.
Referenced by analyze_candidates_and_replace(), execute_fixup_cfg(), remove_unreachable::handle_early(), tree_loop_interchange::interchange(), object_sizes_execute(), remove_unreachable::remove_and_update_globals(), replace_phi_edge_with_variable(), substitute_and_fold_engine::substitute_and_fold(), tree_lower_complex(), and scc_copy_prop::~scc_copy_prop().