GCC Middle and Back End API Reference
tree-ssa-phiprop.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-pretty-print.h"
#include "fold-const.h"
#include "tree-eh.h"
#include "gimplify.h"
#include "gimple-iterator.h"
#include "stor-layout.h"
#include "tree-ssa-loop.h"
#include "tree-cfg.h"
#include "tree-ssa-dce.h"
Include dependency graph for tree-ssa-phiprop.cc:

Data Structures

struct  phiprop_d

Functions

static tree phiprop_insert_phi (basic_block bb, gphi *phi, gimple *use_stmt, struct phiprop_d *phivn, size_t n, bitmap dce_ssa_names)
static bool chk_uses (tree, tree *idx, void *data)
static bool propagate_with_phi (basic_block bb, gphi *vphi, gphi *phi, struct phiprop_d *phivn, size_t n, bitmap dce_ssa_names)
gimple_opt_passmake_pass_phiprop (gcc::context *ctxt)

Function Documentation

◆ chk_uses()

bool chk_uses ( tree ,
tree * idx,
void * data )
static
Verify if *idx is available at *DATA.

References CDI_DOMINATORS, dominated_by_p(), gimple_bb(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, and TREE_CODE.

Referenced by propagate_with_phi().

◆ make_pass_phiprop()

gimple_opt_pass * make_pass_phiprop ( gcc::context * ctxt)

◆ phiprop_insert_phi()

◆ propagate_with_phi()

bool propagate_with_phi ( basic_block bb,
gphi * vphi,
gphi * phi,
struct phiprop_d * phivn,
size_t n,
bitmap dce_ssa_names )
static
Propagate between the phi node arguments of PHI in BB and phi result users. For now this matches # p_2 = PHI <&x, &y> <Lx>:; p_3 = p_2; z_2 = *p_3; and converts it to # z_2 = PHI <x, y> <Lx>:; Returns true if a transformation was done and edge insertions need to be committed. Global data PHIVN and N is used to track past transformation results. VPHI is the virtual PHI node in BB if there is one. We need to be especially careful here with aliasing issues as we are moving memory reads.

References calculate_dominance_info(), CDI_DOMINATORS, CDI_POST_DOMINATORS, cfun, changed, chk_uses(), dom_info_available_p(), dominated_by_p(), FOR_EACH_IMM_USE_FAST, FOR_EACH_IMM_USE_STMT, for_each_index(), FOR_EACH_PHI_ARG, get_immediate_dominator(), gimple_assign_lhs(), gimple_assign_lhs_ptr(), gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_assign_set_rhs1(), gimple_assign_single_p(), gimple_assign_ssa_name_copy_p(), gimple_bb(), gimple_has_volatile_ops(), gimple_phi_arg_def(), gimple_phi_result(), gimple_vdef(), gimple_vuse(), gsi_for_stmt(), gsi_remove(), i, integer_zerop(), is_gimple_assign(), is_gimple_reg_type(), NULL_TREE, phi_arg_index_from_use(), PHI_RESULT, phiprop_insert_phi(), POINTER_TYPE_P, ref_maybe_used_by_stmt_p(), single_imm_use(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VERSION, SSA_OP_USE, stmt_can_throw_internal(), TREE_CODE, TREE_OPERAND, TREE_TYPE, TYPE_MODE, types_compatible_p(), ui, unlink_stmt_vdef(), update_stmt(), USE_FROM_PTR, USE_STMT, value, phiprop_d::value, and phiprop_d::vuse.