GCC Middle and Back End API Reference
ira-conflicts.c File Reference

Functions

static void record_object_conflict ()
static bool build_conflict_bit_table ()
static bool allocnos_conflict_for_copy_p ()
static bool commutative_constraint_p ()
static int get_dup_num ()
static rtx go_through_subreg ()
static bool process_regs_for_copy (rtx reg1, rtx reg2, bool constraint_p, rtx insn, int freq)
static void process_reg_shuffles ()
static void add_insn_allocno_copies ()
static void add_copies ()
static void propagate_copies ()
static void build_object_conflicts ()
static void build_conflicts ()
static void print_hard_reg_set ()
static void print_allocno_conflicts ()
static void print_conflicts ()
void ira_debug_conflicts ()
void ira_build_conflicts ()

Variables

static IRA_INT_TYPE ** conflicts
static ira_object_tcollected_conflict_objects

Function Documentation

static void add_copies ( )
static
Add copies originated from BB given by LOOP_TREE_NODE.   

References add_insn_allocno_copies(), and ira_loop_tree_node::bb.

Referenced by ira_build_conflicts().

static void add_insn_allocno_copies ( )
static
Process INSN and create allocno copies if necessary.  For example,
   it might be because INSN is a pseudo-register move or INSN is two
   operand insn.   

References recog_data_d::constraints, extract_insn(), find_reg_note(), get_dup_num(), recog_data_d::n_operands, recog_data_d::operand, process_reg_shuffles(), process_regs_for_copy(), recog_data, and side_effects_p().

Referenced by add_copies().

static bool allocnos_conflict_for_copy_p ( )
static
Return true iff allocnos A1 and A2 cannot be allocated to the same
   register due to conflicts.   

Referenced by process_regs_for_copy(), and propagate_copies().

static bool build_conflict_bit_table ( )
static
static void build_conflicts ( )
static
Build conflict vectors or bit conflict vectors (whatever is more
   profitable) of all allocnos from the conflict table.   

References build_object_conflicts(), ira_allocate(), ira_free(), ira_objects_num, ira_regno_allocno_map, and max_reg_num().

Referenced by ira_build_conflicts().

static void build_object_conflicts ( )
static
Build conflict vectors or bit conflict vectors (whatever is more
   profitable) for object OBJ from the conflict table.   

References conflicts, ira_allocate_conflict_vec(), ira_conflict_vector_profitable_p(), ira_object_id_map, ira_parent_or_cap_allocno(), and memcpy().

Referenced by build_conflicts().

static bool commutative_constraint_p ( )
static
Return TRUE if the operand constraint STR is commutative.   

References recog_data_d::alternative_enabled_p, and recog_data.

Referenced by get_dup_num().

static int get_dup_num ( )
static
Return the number of the operand which should be the same in any
   case as operand with number OP_NUM (or negative value if there is
   no such operand).  If USE_COMMUT_OP_P is TRUE, the function makes
   temporarily commutative operand exchange before this.  The function
   takes only really possible alternatives into consideration.   

References address_operand(), recog_data_d::alternative_enabled_p, commutative_constraint_p(), recog_data_d::constraints, recog_data_d::n_alternatives, recog_data_d::operand, and recog_data.

Referenced by add_insn_allocno_copies().

static rtx go_through_subreg ( )
static
Return X if X is a REG, otherwise it should be SUBREG of REG and
   the function returns the reg in this case.  *OFFSET will be set to
   0 in the first case or the regno offset in the first case.   

References subreg_regno_offset().

Referenced by process_regs_for_copy().

void ira_build_conflicts ( void  )
void ira_debug_conflicts ( )
Print information about allocno or only regno (if REG_P) conflicts
   to stderr.   

References print_conflicts().

static void print_allocno_conflicts ( )
static
static void print_conflicts ( )
static
Print information about allocno or only regno (if REG_P) conflicts
   to FILE.   

References print_allocno_conflicts().

Referenced by ira_build_conflicts(), and ira_debug_conflicts().

static void print_hard_reg_set ( )
static
Print hard reg set SET with TITLE to FILE.   

Referenced by print_allocno_conflicts().

static void process_reg_shuffles ( )
static
Process all of the output registers of the current insn which are
   not bound (BOUND_P) and the input register REG (its operand number
   OP_NUM) which dies in the insn as if there were a move insn between
   them with frequency FREQ.   

References recog_data_d::n_operands, OP_OUT, recog_data_d::operand, recog_data_d::operand_type, process_regs_for_copy(), and recog_data.

Referenced by add_insn_allocno_copies().

static bool process_regs_for_copy ( rtx  reg1,
rtx  reg2,
bool  constraint_p,
rtx  insn,
int  freq 
)
static
Process registers REG1 and REG2 in move INSN with execution
   frequency FREQ.  The function also processes the registers in a
   potential move insn (INSN == NULL in this case) with frequency
   FREQ.  The function can modify hard register costs of the
   corresponding allocnos or create a copy involving the corresponding
   allocnos.  The function does nothing if the both registers are hard
   registers.  When nothing is changed, the function returns
   FALSE.   

References allocnos_conflict_for_copy_p(), bitmap_set_bit(), go_through_subreg(), ira_add_allocno_copy(), ira_allocate_and_set_costs(), ira_curr_loop_tree_node, ira_curr_regno_allocno_map, ira_init_register_move_cost_if_necessary(), ira_parent_or_cap_allocno(), ira_loop_tree_node::local_copies, and ira_allocno_copy::num.

Referenced by add_insn_allocno_copies(), and process_reg_shuffles().

static void record_object_conflict ( )
static
Record a conflict between objects OBJ1 and OBJ2.  If necessary,
   canonicalize the conflict by recording it for lower-order subobjects
   of the corresponding allocnos.  

References conflicts.

Referenced by build_conflict_bit_table().


Variable Documentation

ira_object_t* collected_conflict_objects
static
Array used to collect all conflict allocnos for given allocno.   
IRA_INT_TYPE** conflicts
static
@verbatim IRA conflict builder.

Copyright (C) 2006-2013 Free Software Foundation, Inc. Contributed by Vladimir Makarov vmaka.nosp@m.rov@.nosp@m.redha.nosp@m.t.co.nosp@m.m.

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

This file contains code responsible for allocno conflict creation,
   allocno copy creation and allocno info accumulation on upper level
   regions.   
ira_allocnos_num array of arrays of bits, recording whether two
   allocno's conflict (can't go in the same hardware register).

   Some arrays will be used as conflict bit vector of the
   corresponding allocnos see function build_object_conflicts.   

Referenced by build_conflict_bit_table(), build_object_conflicts(), ira_build_conflicts(), and record_object_conflict().