GCC Middle and Back End API Reference
stmt_stats Struct Reference

Data Fields

int total
 
int total_phis
 
int removed
 
int removed_phis
 

Detailed Description

Dead code elimination pass for the GNU compiler.
   Copyright (C) 2002-2024 Free Software Foundation, Inc.
   Contributed by Ben Elliston <bje@redhat.com>
   and Andrew MacLeod <amacleod@redhat.com>
   Adapted to use control dependence by Steven Bosscher, SUSE Labs.

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/>.   
Dead code elimination.

References:

  Building an Optimizing Compiler,
  Robert Morgan, Butterworth-Heinemann, 1998, Section 8.9.

  Advanced Compiler Design and Implementation,
  Steven Muchnick, Morgan Kaufmann, 1997, Section 18.10.

Dead-code elimination is the removal of statements which have no
impact on the program's output.  "Dead statements" have no impact
on the program's output, while "necessary statements" may have
impact on the output.

The algorithm consists of three phases:
1. Marking as necessary all statements known to be necessary,
   e.g. most function calls, writing a value to memory, etc;
2. Propagating necessary statements, e.g., the statements
   giving values to operands in necessary statements; and
3. Removing dead statements.   

Field Documentation

◆ removed

int stmt_stats::removed

◆ removed_phis

int stmt_stats::removed_phis

◆ total

int stmt_stats::total

◆ total_phis

int stmt_stats::total_phis

The documentation for this struct was generated from the following file: