Add VEC_WIDEN_MULT_EVEN/ODD_EXPR
[platform/upstream/gcc.git] / gcc / ira.h
1 /* Communication between the Integrated Register Allocator (IRA) and
2    the rest of the compiler.
3    Copyright (C) 2006, 2007, 2008, 2009, 2010
4    Free Software Foundation, Inc.
5    Contributed by Vladimir Makarov <vmakarov@redhat.com>.
6
7 This file is part of GCC.
8
9 GCC is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 3, or (at your option) any later
12 version.
13
14 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17 for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING3.  If not see
21 <http://www.gnu.org/licenses/>.  */
22
23 /* True if we have allocno conflicts.  It is false for non-optimized
24    mode or when the conflict table is too big.  */
25 extern bool ira_conflicts_p;
26
27 struct target_ira {
28   /* Map: hard register number -> allocno class it belongs to.  If the
29      corresponding class is NO_REGS, the hard register is not available
30      for allocation.  */
31   enum reg_class x_ira_hard_regno_allocno_class[FIRST_PSEUDO_REGISTER];
32
33   /* Number of allocno classes.  Allocno classes are register classes
34      which can be used for allocations of allocnos.  */
35   int x_ira_allocno_classes_num;
36
37   /* The array containing allocno classes.  Only first
38      IRA_ALLOCNO_CLASSES_NUM elements are used for this.  */
39   enum reg_class x_ira_allocno_classes[N_REG_CLASSES];
40
41   /* Map of all register classes to corresponding allocno classes
42      containing the given class.  If given class is not a subset of an
43      allocno class, we translate it into the cheapest allocno class.  */
44   enum reg_class x_ira_allocno_class_translate[N_REG_CLASSES];
45
46   /* Number of pressure classes.  Pressure classes are register
47      classes for which we calculate register pressure.  */
48   int x_ira_pressure_classes_num;
49
50   /* The array containing pressure classes.  Only first
51      IRA_PRESSURE_CLASSES_NUM elements are used for this.  */
52   enum reg_class x_ira_pressure_classes[N_REG_CLASSES];
53
54   /* Map of all register classes to corresponding pressure classes
55      containing the given class.  If given class is not a subset of an
56      pressure class, we translate it into the cheapest pressure
57      class.  */
58   enum reg_class x_ira_pressure_class_translate[N_REG_CLASSES];
59
60   /* Bigest pressure register class containing stack registers.
61      NO_REGS if there are no stack registers.  */
62   enum reg_class x_ira_stack_reg_pressure_class;
63
64   /* Maps: register class x machine mode -> maximal/minimal number of
65      hard registers of given class needed to store value of given
66      mode.  */
67   unsigned char x_ira_reg_class_max_nregs[N_REG_CLASSES][MAX_MACHINE_MODE];
68   unsigned char x_ira_reg_class_min_nregs[N_REG_CLASSES][MAX_MACHINE_MODE];
69
70   /* Array analogous to target hook TARGET_MEMORY_MOVE_COST.  */
71   short x_ira_memory_move_cost[MAX_MACHINE_MODE][N_REG_CLASSES][2];
72
73   /* Array of number of hard registers of given class which are
74      available for the allocation.  The order is defined by the
75      allocation order.  */
76   short x_ira_class_hard_regs[N_REG_CLASSES][FIRST_PSEUDO_REGISTER];
77
78   /* The number of elements of the above array for given register
79      class.  */
80   int x_ira_class_hard_regs_num[N_REG_CLASSES];
81
82   /* Function specific hard registers can not be used for the register
83      allocation.  */
84   HARD_REG_SET x_ira_no_alloc_regs;
85 };
86
87 extern struct target_ira default_target_ira;
88 #if SWITCHABLE_TARGET
89 extern struct target_ira *this_target_ira;
90 #else
91 #define this_target_ira (&default_target_ira)
92 #endif
93
94 #define ira_hard_regno_allocno_class \
95   (this_target_ira->x_ira_hard_regno_allocno_class)
96 #define ira_allocno_classes_num \
97   (this_target_ira->x_ira_allocno_classes_num)
98 #define ira_allocno_classes \
99   (this_target_ira->x_ira_allocno_classes)
100 #define ira_allocno_class_translate \
101   (this_target_ira->x_ira_allocno_class_translate)
102 #define ira_pressure_classes_num \
103   (this_target_ira->x_ira_pressure_classes_num)
104 #define ira_pressure_classes \
105   (this_target_ira->x_ira_pressure_classes)
106 #define ira_pressure_class_translate \
107   (this_target_ira->x_ira_pressure_class_translate)
108 #define ira_stack_reg_pressure_class \
109   (this_target_ira->x_ira_stack_reg_pressure_class)
110 #define ira_reg_class_max_nregs \
111   (this_target_ira->x_ira_reg_class_max_nregs)
112 #define ira_reg_class_min_nregs \
113   (this_target_ira->x_ira_reg_class_min_nregs)
114 #define ira_memory_move_cost \
115   (this_target_ira->x_ira_memory_move_cost)
116 #define ira_class_hard_regs \
117   (this_target_ira->x_ira_class_hard_regs)
118 #define ira_class_hard_regs_num \
119   (this_target_ira->x_ira_class_hard_regs_num)
120 #define ira_no_alloc_regs \
121   (this_target_ira->x_ira_no_alloc_regs)
122
123 extern void ira_init_once (void);
124 extern void ira_init (void);
125 extern void ira_finish_once (void);
126 extern void ira_setup_eliminable_regset (void);
127 extern rtx ira_eliminate_regs (rtx, enum machine_mode);
128 extern void ira_set_pseudo_classes (FILE *);
129 extern void ira_implicitly_set_insn_hard_regs (HARD_REG_SET *);
130
131 extern void ira_sort_regnos_for_alter_reg (int *, int, unsigned int *);
132 extern void ira_mark_allocation_change (int);
133 extern void ira_mark_memory_move_deletion (int, int);
134 extern bool ira_reassign_pseudos (int *, int, HARD_REG_SET, HARD_REG_SET *,
135                                   HARD_REG_SET *, bitmap);
136 extern rtx ira_reuse_stack_slot (int, unsigned int, unsigned int);
137 extern void ira_mark_new_stack_slot (rtx, int, unsigned int);
138 extern bool ira_better_spill_reload_regno_p (int *, int *, rtx, rtx, rtx);
139 extern bool ira_bad_reload_regno (int, rtx, rtx);
140
141 extern void ira_adjust_equiv_reg_cost (unsigned, int);