GCC Middle and Back End API Reference
web.c File Reference

Functions

struct web_entryunionfind_root ()
bool unionfind_union ()
static void union_match_dups (rtx insn, struct web_entry *def_entry, struct web_entry *use_entry, bool(*fun)(struct web_entry *, struct web_entry *))
void union_defs (df_ref use, struct web_entry *def_entry, unsigned int *used, struct web_entry *use_entry, bool(*fun)(struct web_entry *, struct web_entry *))
static rtx entry_register ()
static void replace_ref ()
static bool gate_handle_web ()
static unsigned int web_main ()
rtl_opt_passmake_pass_web ()

Function Documentation

static rtx entry_register ( )
static
Find the corresponding register for the given entry.   

References dump_file, gen_reg_rtx(), web_entry::reg, and unionfind_root().

Referenced by web_main().

static bool gate_handle_web ( )
static
rtl_opt_pass* make_pass_web ( )
static void replace_ref ( )
static
Replace the reference by REG.   

References df_insn_rescan(), dump_file, and web_entry::reg.

Referenced by web_main().

void union_defs ( df_ref  use,
struct web_entry def_entry,
unsigned int *  used,
struct web_entry use_entry,
bool(*)(struct web_entry *, struct web_entry *)  fun 
)
For each use, all possible defs reaching it must come in the same
   register, union them.
   FUN is the function that does the union.

   In USED, we keep the DF_REF_ID of the first uninitialized uses of a
   register, so that all uninitialized uses of the register can be
   combined into a single web.  We actually offset it by 2, because
   the values 0 and 1 are reserved for use by entry_register.   

References DF_REF_READ_WRITE, df_insn_info::insn, df_link::next, and df_link::ref.

Referenced by web_main().

static void union_match_dups ( rtx  insn,
struct web_entry def_entry,
struct web_entry use_entry,
bool(*)(struct web_entry *, struct web_entry *)  fun 
)
static
For INSN, union all defs and uses that are linked by match_dup.
   FUN is the function that does the union.   

References recog_data_d::dup_loc, recog_data_d::dup_num, extract_insn(), recog_data_d::n_dups, OP_IN, OP_INOUT, recog_data_d::operand_loc, recog_data_d::operand_type, and recog_data.

Referenced by web_main().

struct web_entry* unionfind_root ( )
read
@verbatim Web construction code for GNU compiler.

Contributed by Jan Hubicka. Copyright (C) 2001-2013 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/.

Simple optimization pass that splits independent uses of each pseudo,
   increasing effectiveness of other optimizations.  The optimization can
   serve as an example of use for the dataflow module.

   We don't split registers with REG_USERVAR set unless -fmessy-debugging
   is specified, because debugging information about such split variables
   is almost unusable.

   TODO
    - We may use profile information and ignore infrequent use for the
      purpose of web unifying, inserting the compensation code later to
      implement full induction variable expansion for loops (currently
      we expand only if the induction variable is dead afterward, which
      is often the case).   
Find the root of unionfind tree (the representative of set).   

References web_entry::pred.

bool unionfind_union ( )
Union sets.
   Return true if FIRST and SECOND points to the same web entry structure and
   nothing is done.  Otherwise, return false.   

References first, web_entry::pred, and unionfind_root().