{
/* The node represents basic block if children == NULL. */
basic_block bb; /* NULL for loop. */
- struct loop *loop; /* NULL for BB. */
+ /* NULL for BB or for loop tree root if we did not build CFG loop tree. */
+ struct loop *loop;
/* NEXT/SUBLOOP_NEXT is the next node/loop-node of the same parent.
SUBLOOP_NEXT is always NULL for BBs. */
ira_loop_tree_node_t subloop_next, next;
/* All the following members are defined only for nodes representing
loops. */
+ /* The loop number from CFG loop tree. The root number is 0. */
+ int loop_num;
+
/* True if the loop was marked for removal from the register
allocation. */
bool to_remove_p;
/* Two access macros to the nodes representing basic blocks. */
#if defined ENABLE_IRA_CHECKING && (GCC_VERSION >= 2007)
#define IRA_BB_NODE_BY_INDEX(index) __extension__ \
-(({ ira_loop_tree_node_t _node = (&ira_bb_nodes[index]); \
+(({ ira_loop_tree_node_t _node = (&ira_bb_nodes[index]); \
if (_node->children != NULL || _node->loop != NULL || _node->bb == NULL)\
{ \
fprintf (stderr, \
/* Two access macros to the nodes representing loops. */
#if defined ENABLE_IRA_CHECKING && (GCC_VERSION >= 2007)
#define IRA_LOOP_NODE_BY_INDEX(index) __extension__ \
-(({ ira_loop_tree_node_t const _node = (&ira_loop_nodes[index]);\
- if (_node->children == NULL || _node->bb != NULL || _node->loop == NULL)\
+(({ ira_loop_tree_node_t const _node = (&ira_loop_nodes[index]); \
+ if (_node->children == NULL || _node->bb != NULL \
+ || (_node->loop == NULL && current_loops != NULL)) \
{ \
fprintf (stderr, \
"\n%s: %d: error in %s: it is not a loop node\n", \
ira_object structures. Otherwise, we use a bit vector indexed
by conflict ID numbers. */
unsigned int conflict_vec_p : 1;
- /* Different additional data. It is used to decrease size of
- allocno data footprint. */
- void *add_data;
};
/* A structure representing an allocno (allocation entity). Allocno
#define OBJECT_MAX(O) ((O)->max)
#define OBJECT_CONFLICT_ID(O) ((O)->id)
#define OBJECT_LIVE_RANGES(O) ((O)->live_ranges)
-#define OBJECT_ADD_DATA(O) ((O)->add_data)
/* Map regno -> allocnos with given regno (see comments for
allocno member `next_regno_allocno'). */
int x_ira_class_subset_p[N_REG_CLASSES][N_REG_CLASSES];
/* Array of the number of hard registers of given class which are
- available for allocation. The order is defined by the the hard
+ available for allocation. The order is defined by the hard
register numbers. */
short x_ira_non_ordered_class_hard_regs[N_REG_CLASSES][FIRST_PSEUDO_REGISTER];
extern ira_copy_t ira_add_allocno_copy (ira_allocno_t, ira_allocno_t, int,
bool, rtx, ira_loop_tree_node_t);
-extern int *ira_allocate_cost_vector (enum reg_class);
-extern void ira_free_cost_vector (int *, enum reg_class);
+extern int *ira_allocate_cost_vector (reg_class_t);
+extern void ira_free_cost_vector (int *, reg_class_t);
extern void ira_flattening (int, int);
-extern bool ira_build (bool);
+extern bool ira_build (void);
extern void ira_destroy (void);
/* ira-costs.c */
}
/* The function returns TRUE if hard registers starting with
- HARD_REGNO and containing value of MODE are not in set
+ HARD_REGNO and containing value of MODE are fully in set
HARD_REGSET. */
static inline bool
-ira_hard_reg_not_in_set_p (int hard_regno, enum machine_mode mode,
- HARD_REG_SET hard_regset)
+ira_hard_reg_in_set_p (int hard_regno, enum machine_mode mode,
+ HARD_REG_SET hard_regset)
{
int i;
ira_assert (hard_regno >= 0);
for (i = hard_regno_nregs[hard_regno][mode] - 1; i >= 0; i--)
- if (TEST_HARD_REG_BIT (hard_regset, hard_regno + i))
+ if (!TEST_HARD_REG_BIT (hard_regset, hard_regno + i))
return false;
return true;
}
/* Allocate cost vector *VEC for hard registers of ACLASS and
initialize the elements by VAL if it is necessary */
static inline void
-ira_allocate_and_set_costs (int **vec, enum reg_class aclass, int val)
+ira_allocate_and_set_costs (int **vec, reg_class_t aclass, int val)
{
int i, *reg_costs;
int len;
if (*vec != NULL)
return;
*vec = reg_costs = ira_allocate_cost_vector (aclass);
- len = ira_class_hard_regs_num[aclass];
+ len = ira_class_hard_regs_num[(int) aclass];
for (i = 0; i < len; i++)
reg_costs[i] = val;
}