GCC Middle and Back End API Reference
gimple-ssa-sccopy.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "tree.h"
#include "gimple.h"
#include "tree-pass.h"
#include "ssa.h"
#include "gimple-iterator.h"
#include "vec.h"
#include "hash-set.h"
#include "ssa-iterators.h"
#include "gimple-fold.h"
#include "gimplify.h"
#include "tree-cfg.h"
#include "tree-eh.h"
#include "builtins.h"
#include "tree-ssa-dce.h"
#include "fold-const.h"
Include dependency graph for gimple-ssa-sccopy.cc:

Data Structures

class  scc_copy_prop
 

Macros

#define INCLUDE_ALGORITHM
 

Functions

static bool stmt_may_generate_copy (gimple *stmt)
 
static auto_vec< gimple * > get_all_stmt_may_generate_copy (void)
 
gimple_opt_passmake_pass_sccopy (gcc::context *ctxt)
 

Macro Definition Documentation

◆ INCLUDE_ALGORITHM

#define INCLUDE_ALGORITHM
Strongly-connected copy propagation pass for the GNU compiler.
   Copyright (C) 2023-2024 Free Software Foundation, Inc.
   Contributed by Filip Kastl <fkastl@suse.cz>

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/>.   

Function Documentation

◆ get_all_stmt_may_generate_copy()

static auto_vec< gimple * > get_all_stmt_may_generate_copy ( void )
static
Return all statements in cfun that could generate copies.  All statements
for which stmt_may_generate_copy returns 'true'.   

References cfun, FOR_EACH_BB_FN, gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), gphi_iterator::phi(), and stmt_may_generate_copy().

Referenced by scc_copy_prop::propagate().

◆ make_pass_sccopy()

gimple_opt_pass * make_pass_sccopy ( gcc::context * ctxt)

◆ stmt_may_generate_copy()

static bool stmt_may_generate_copy ( gimple * stmt)
static
Could this statement potentially be a copy statement?

This pass only considers statements for which this function returns 'true'.
Those are basically PHI functions and assignment statements similar to

_2 = _1;
or
_2 = 5;   

References as_a(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_single_p(), gimple_phi_arg_def(), gimple_phi_num_args(), gimple_phi_result(), i, is_gimple_min_invariant(), NULL_TREE, operand_equal_p(), POINTER_TYPE_P, SSA_NAME_OCCURS_IN_ABNORMAL_PHI, SSA_NAME_PTR_INFO, SSA_NAME_RANGE_INFO, TREE_CODE, and TREE_TYPE.

Referenced by get_all_stmt_may_generate_copy().