2007-12-17 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / ira-int.h
blob4030173c47bfc210a50a9cc8a473f1cd3c7425a0
1 /* Integrated Register Allocator intercommunication header file.
2 Copyright (C) 2006, 2007
3 Free Software Foundation, Inc.
4 Contributed by Vladimir Makarov <vmakarov@redhat.com>.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
11 version.
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to the Free
20 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
21 02110-1301, USA. */
23 #include "cfgloop.h"
24 #include "ira.h"
25 #include "alloc-pool.h"
27 #ifdef ENABLE_CHECKING
28 #define ENABLE_IRA_CHECKING
29 #endif
31 #ifdef ENABLE_IRA_CHECKING
32 #define ira_assert(c) gcc_assert (c)
33 #else
34 #define ira_assert(c)
35 #endif
37 /* Compute register frequency from edge frequency FREQ. It is
38 analogous to REG_FREQ_FROM_BB. When optimizing for size, or
39 profile driven feedback is available and the function is never
40 executed, frequency is always equivalent. Otherwise rescale edge
41 frequency. */
42 #define REG_FREQ_FROM_EDGE_FREQ(freq) \
43 (optimize_size || (flag_branch_probabilities && !ENTRY_BLOCK_PTR->count) \
44 ? REG_FREQ_MAX : (freq * REG_FREQ_MAX / BB_FREQ_MAX) \
45 ? (freq * REG_FREQ_MAX / BB_FREQ_MAX) : 1)
47 /* All natural loops. */
48 extern struct loops ira_loops;
50 /* The flag value used internally. */
51 extern int internal_flag_ira_verbose;
53 /* Dump file of the allocator if it is not NULL. */
54 extern FILE *ira_dump_file;
56 /* Pools for allocnos, copies, allocno live ranges. */
57 extern alloc_pool allocno_pool, copy_pool, allocno_live_range_pool;
59 /* Allocno live range, allocno, and copy of allocnos. */
60 typedef struct loop_tree_node *loop_tree_node_t;
61 typedef struct allocno_live_range *allocno_live_range_t;
62 typedef struct allocno *allocno_t;
63 typedef struct allocno_copy *copy_t;
65 /* The following structure describes loop tree node (block or loop).
66 We need such tree because the loop tree from cfgloop.h is not
67 convenient for the optimization (because basic blocks are not a
68 part of the tree from cfgloop.h). We also use the nodes for
69 storing additional information about basic blocks/loops for the
70 register allocation. */
71 struct loop_tree_node
73 /* The node represents basic block if inner == NULL. */
74 basic_block bb; /* NULL for loop. */
75 struct loop *loop; /* NULL for BB. */
76 /* The next node on the same tree level. */
77 loop_tree_node_t next;
78 /* The first node immediately inside the node. */
79 loop_tree_node_t inner;
80 /* The node containing given node. */
81 loop_tree_node_t father;
83 /* Loop level in range [0, ira_loop_tree_height). */
84 int level;
86 /* Allocnos in loop corresponding to regnos. If it is NULL the loop
87 is not included in the loop tree (e.g. it has abnormal enter/exit
88 edges). */
89 allocno_t *regno_allocno_map;
91 /* Maximal register pressure inside loop for given class (defined
92 only for cover_class). */
93 int reg_pressure [N_REG_CLASSES];
95 /* Allocnos referred in the loop node. */
96 bitmap mentioned_allocnos;
98 /* Regnos modified in the loop node (including its subloops). */
99 bitmap modified_regnos;
101 /* Allocnos living at the loop borders. */
102 bitmap border_allocnos;
104 /* Copies referred in the loop node. */
105 bitmap local_copies;
108 /* The root of the loop tree corresponding to the all function. */
109 extern loop_tree_node_t ira_loop_tree_root;
111 /* Height of the loop tree. */
112 extern int ira_loop_tree_height;
114 /* All basic block data are referred through the following array. We
115 can not use member `aux' for this because it is used for insertion
116 of insns on edges. */
117 extern loop_tree_node_t ira_bb_nodes;
119 /* Two access macros to the basic block data. */
120 #if defined ENABLE_IRA_CHECKING && (GCC_VERSION >= 2007)
121 #define IRA_BB_NODE_BY_INDEX(index) __extension__ \
122 (({ loop_tree_node_t _node = (&ira_bb_nodes [index]); \
123 if (_node->inner != NULL || _node->loop != NULL || _node->bb == NULL)\
125 fprintf (stderr, \
126 "\n%s: %d: error in %s: it is not a block node\n", \
127 __FILE__, __LINE__, __FUNCTION__); \
128 exit (1); \
130 _node; }))
131 #else
132 #define IRA_BB_NODE_BY_INDEX(index) (&ira_bb_nodes [index])
133 #endif
135 #define IRA_BB_NODE(bb) IRA_BB_NODE_BY_INDEX ((bb)->index)
137 /* All loop data are referred through the following array. */
138 extern loop_tree_node_t ira_loop_nodes;
140 /* Two access macros to the loop data. */
141 #if defined ENABLE_IRA_CHECKING && (GCC_VERSION >= 2007)
142 #define IRA_LOOP_NODE_BY_INDEX(index) __extension__ \
143 (({ loop_tree_node_t const _node = (&ira_loop_nodes [index]);\
144 if (_node->inner == NULL || _node->bb != NULL || _node->loop == NULL)\
146 fprintf (stderr, \
147 "\n%s: %d: error in %s: it is not a loop node\n", \
148 __FILE__, __LINE__, __FUNCTION__); \
149 exit (1); \
151 _node; }))
152 #else
153 #define IRA_LOOP_NODE_BY_INDEX(index) (&ira_loop_nodes [index])
154 #endif
156 #define IRA_LOOP_NODE(loop) IRA_LOOP_NODE_BY_INDEX ((loop)->num)
160 /* The structure describes program points where a given allocno
161 lives. */
162 struct allocno_live_range
164 /* Allocno whose live range is described by given structure. */
165 allocno_t allocno;
166 /* Program point range. */
167 int start, finish;
168 /* Next structure describing program points where the allocno
169 lives. */
170 allocno_live_range_t next;
171 /* Pointer to structures with the same start/finish. */
172 allocno_live_range_t start_next, finish_next;
175 /* Program points are enumerated by number from range
176 0..MAX_POINT-1. */
177 extern int max_point;
179 /* Arrays of size MAX_POINT mapping a program point to the allocno
180 live ranges with given start/finish point. */
181 extern allocno_live_range_t *start_point_ranges, *finish_point_ranges;
183 /* Node representing allocnos (allocation entity). */
184 struct allocno
186 /* The allocno order number starting with 0. */
187 int num;
188 /* Regno for allocno or cap. */
189 int regno;
190 /* Mode of the allocno. */
191 enum machine_mode mode;
192 /* Final rtx representation of the allocno. */
193 rtx reg;
194 /* Hard register assigned to given allocno. Negative value means
195 that memory was allocated to the allocno. */
196 int hard_regno;
197 /* Allocnos with the same regno are linked by the following member.
198 Allocnos corresponding to inner loops are first in the list
199 (depth-first tarverse). */
200 allocno_t next_regno_allocno;
201 /* There may be different allocnos with the same regno. They are
202 bound to a loop tree node. */
203 loop_tree_node_t loop_tree_node;
204 /* Accumulated usage references of the allocno. */
205 int nrefs;
206 /* Accumulated frequency of usage of the allocno. */
207 int freq;
208 /* Register class which should be used for allocation for given
209 allocno. NO_REGS means that we should use memory. */
210 enum reg_class cover_class;
211 /* The biggest register class with minimal cost usage for given
212 allocno. */
213 enum reg_class best_class;
214 /* Minimal accumulated cost of usage register of the cover class for
215 the allocno. */
216 int cover_class_cost;
217 /* Minimal accumulated, and updated costs of memory for the
218 allocno. */
219 int memory_cost, updated_memory_cost;
220 /* Copies to other non-conflicting allocnos. The copies can
221 represent move insn or potential move insn usually because of two
222 operand constraints. */
223 copy_t allocno_copies;
224 /* It is a allocno (cap) representing given allocno on upper loop tree
225 level. */
226 allocno_t cap;
227 /* It is a link to allocno (cap) on lower loop level represented by
228 given cap. Null if it is not a cap. */
229 allocno_t cap_member;
230 /* Coalesced allocnos form a cyclic list. One allocno given by
231 FIRST_COALESCED_ALLOCNO represents all coalesced allocnos. The
232 list is chained by NEXT_COALESCED_ALLOCNO. */
233 allocno_t first_coalesced_allocno;
234 allocno_t next_coalesced_allocno;
235 /* Pointer to structures describing at what program point the
236 allocno lives. We always maintain the condition that *ranges in
237 the list are not intersected and ordered by decreasing their
238 program points*. */
239 allocno_live_range_t live_ranges;
240 /* Vector of conflicting allocnos with NULL end marker (first
241 initial and then accumulated conflict allocnos). Only allocnos
242 with the same cover class are in the vector. */
243 allocno_t *conflict_allocno_vec;
244 /* Allocated size of the previous array. */
245 int conflict_allocno_vec_size;
246 /* Numbers of initial and total (with) accumulated conflicts in the
247 previous array. */
248 int conflict_allocnos_num, total_conflict_allocnos_num;
249 /* Initial and accumulated hard registers conflicting with this
250 allocno and as a consequences can not be assigned to the
251 allocno. */
252 HARD_REG_SET conflict_hard_regs, total_conflict_hard_regs;
253 /* Accumulated frequency of calls which given allocno
254 intersects. */
255 int call_freq;
256 /* Start index of calls intersected by the allocno in
257 regno_calls [regno]. */
258 int calls_crossed_start;
259 /* Length of the previous array (number of the intersected calls). */
260 int calls_crossed_num;
261 /* Non NULL if we remove restoring value from given allocno to
262 MEM_OPTIMIZED_DEST at the end of loop because the value is not
263 changed in loop. */
264 allocno_t mem_optimized_dest;
265 /* TRUE if the allocno was a destination of removed move at the end
266 of loop because the value is not changed in loop. */
267 unsigned int mem_optimized_dest_p : 1;
269 #ifdef STACK_REGS
270 /* Set to TRUE if allocno can't be allocated in the stack
271 register. */
272 unsigned int no_stack_reg_p : 1, total_no_stack_reg_p : 1;
273 #endif
274 /* TRUE value means than the allocno was not removed from the
275 conflicting graph during colouring. */
276 unsigned int in_graph_p : 1;
277 /* TRUE if a hard register or memory has been assigned to the
278 allocno. */
279 unsigned int assigned_p : 1;
280 /* TRUE if it is put on the stack to make other allocnos
281 colorable. */
282 unsigned int may_be_spilled_p : 1;
283 /* Array of additional costs (accumulated and the one updated during
284 coloring) for hard regno of allocno cover class. If given
285 allocno represents a set of allocnos the current costs represents
286 costs of the all set. */
287 int *hard_reg_costs, *updated_hard_reg_costs;
288 /* Array of decreasing costs (accumulated and the one updated during
289 coloring) for conflicting allocnos for hard regno of the allocno
290 cover class. The member values can be NULL if all costs are the
291 same. If given allocno represents a set of allocnos the current
292 costs represents costs of the all set. */
293 int *conflict_hard_reg_costs, *updated_conflict_hard_reg_costs;
294 /* Number of allocnos with TRUE in_graph_p value and conflicting with
295 given allocno. */
296 int left_conflicts_num;
297 /* Number of hard register of the allocno cover class really
298 availiable for the allocno allocation. */
299 int available_regs_num;
300 /* Allocnos in a bucket (used in coloring) chained by the following
301 two members. */
302 allocno_t next_bucket_allocno;
303 allocno_t prev_bucket_allocno;
304 /* Used for temporary purposes. */
305 int temp;
308 /* All members of the allocno node should be accessed only through the
309 following macros. */
310 #define ALLOCNO_NUM(A) ((A)->num)
311 #define ALLOCNO_REGNO(A) ((A)->regno)
312 #define ALLOCNO_REG(A) ((A)->reg)
313 #define ALLOCNO_NEXT_REGNO_ALLOCNO(A) ((A)->next_regno_allocno)
314 #define ALLOCNO_LOOP_TREE_NODE(A) ((A)->loop_tree_node)
315 #define ALLOCNO_CAP(A) ((A)->cap)
316 #define ALLOCNO_CAP_MEMBER(A) ((A)->cap_member)
317 #define ALLOCNO_CONFLICT_ALLOCNO_VEC(A) ((A)->conflict_allocno_vec)
318 #define ALLOCNO_CONFLICT_ALLOCNO_VEC_SIZE(A) ((A)->conflict_allocno_vec_size)
319 #define ALLOCNO_CONFLICT_ALLOCNOS_NUM(A) ((A)->conflict_allocnos_num)
320 #define ALLOCNO_TOTAL_CONFLICT_ALLOCNOS_NUM(A) \
321 ((A)->total_conflict_allocnos_num)
322 #define ALLOCNO_CONFLICT_HARD_REGS(A) ((A)->conflict_hard_regs)
323 #define ALLOCNO_TOTAL_CONFLICT_HARD_REGS(A) ((A)->total_conflict_hard_regs)
324 #define ALLOCNO_NREFS(A) ((A)->nrefs)
325 #define ALLOCNO_FREQ(A) ((A)->freq)
326 #define ALLOCNO_HARD_REGNO(A) ((A)->hard_regno)
327 #define ALLOCNO_CALL_FREQ(A) ((A)->call_freq)
328 #define ALLOCNO_CALLS_CROSSED_START(A) ((A)->calls_crossed_start)
329 #define ALLOCNO_CALLS_CROSSED_NUM(A) ((A)->calls_crossed_num)
330 #define ALLOCNO_MEM_OPTIMIZED_DEST(A) ((A)->mem_optimized_dest)
331 #define ALLOCNO_MEM_OPTIMIZED_DEST_P(A) ((A)->mem_optimized_dest_p)
332 #ifdef STACK_REGS
333 #define ALLOCNO_NO_STACK_REG_P(A) ((A)->no_stack_reg_p)
334 #define ALLOCNO_TOTAL_NO_STACK_REG_P(A) ((A)->total_no_stack_reg_p)
335 #endif
336 #define ALLOCNO_IN_GRAPH_P(A) ((A)->in_graph_p)
337 #define ALLOCNO_ASSIGNED_P(A) ((A)->assigned_p)
338 #define ALLOCNO_MAY_BE_SPILLED_P(A) ((A)->may_be_spilled_p)
339 #define ALLOCNO_MODE(A) ((A)->mode)
340 #define ALLOCNO_COPIES(A) ((A)->allocno_copies)
341 #define ALLOCNO_HARD_REG_COSTS(A) ((A)->hard_reg_costs)
342 #define ALLOCNO_UPDATED_HARD_REG_COSTS(A) ((A)->updated_hard_reg_costs)
343 #define ALLOCNO_CONFLICT_HARD_REG_COSTS(A) \
344 ((A)->conflict_hard_reg_costs)
345 #define ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS(A) \
346 ((A)->updated_conflict_hard_reg_costs)
347 #define ALLOCNO_LEFT_CONFLICTS_NUM(A) ((A)->left_conflicts_num)
348 #define ALLOCNO_BEST_CLASS(A) ((A)->best_class)
349 #define ALLOCNO_COVER_CLASS(A) ((A)->cover_class)
350 #define ALLOCNO_COVER_CLASS_COST(A) ((A)->cover_class_cost)
351 #define ALLOCNO_MEMORY_COST(A) ((A)->memory_cost)
352 #define ALLOCNO_UPDATED_MEMORY_COST(A) ((A)->updated_memory_cost)
353 #define ALLOCNO_AVAILABLE_REGS_NUM(A) ((A)->available_regs_num)
354 #define ALLOCNO_NEXT_BUCKET_ALLOCNO(A) ((A)->next_bucket_allocno)
355 #define ALLOCNO_PREV_BUCKET_ALLOCNO(A) ((A)->prev_bucket_allocno)
356 #define ALLOCNO_TEMP(A) ((A)->temp)
357 #define ALLOCNO_FIRST_COALESCED_ALLOCNO(A) ((A)->first_coalesced_allocno)
358 #define ALLOCNO_NEXT_COALESCED_ALLOCNO(A) ((A)->next_coalesced_allocno)
359 #define ALLOCNO_LIVE_RANGES(A) ((A)->live_ranges)
361 /* Map regno -> allocnos. */
362 extern allocno_t *regno_allocno_map;
364 /* Array of references to all allocnos. The order number of the
365 allocno corresponds to the index in the array. */
366 extern allocno_t *allocnos;
368 /* Sizes of the previous array. */
369 extern int allocnos_num;
371 /* The following structure represents a copy of given allocno to
372 another allocno. The copies represent move insns or potential move
373 insns usually because of two operand constraints. */
374 struct allocno_copy
376 /* The order number of the copy node starting with 0. */
377 int num;
378 /* Allocno connected by the copy. The first one should have smaller
379 order number than the second one. */
380 allocno_t first, second;
381 /* Execution frequency of the copy. */
382 int freq;
383 /* It is a move insn if the copy represents it, potential move insn
384 is represented by NULL. */
385 rtx move_insn;
386 /* Copies with the same allocno as FIRST are linked by the two
387 following members. */
388 copy_t prev_first_allocno_copy, next_first_allocno_copy;
389 /* Copies with the same allocno as SECOND are linked by the two
390 following members. */
391 copy_t prev_second_allocno_copy, next_second_allocno_copy;
392 /* Region from which given copy is originated. */
393 loop_tree_node_t loop_tree_node;
396 /* Array of references to copies. The order number of the copy
397 corresponds to the index in the array. */
398 extern copy_t *copies;
400 /* Size of the previous array. */
401 extern int copies_num;
403 /* The following structure describes a stack slot used for spilled
404 registers. */
405 struct spilled_reg_stack_slot
407 /* pseudo-registers have used the stack slot. */
408 regset_head spilled_regs;
409 /* RTL representation of the stack slot. */
410 rtx mem;
411 /* Size of the stack slot. */
412 unsigned int width;
415 /* The number of elements in the following array. */
416 extern int spilled_reg_stack_slots_num;
418 /* The following array contains description of spilled registers stack
419 slots have been used in current function so far. */
420 extern struct spilled_reg_stack_slot *spilled_reg_stack_slots;
422 /* Correspondingly overall cost of the allocation, cost of hard
423 register usage for the allocnos, cost of memory usage for the
424 allocnos, cost of loads, stores and register move insns generated
425 for register live range splitting. */
426 extern int overall_cost;
427 extern int reg_cost, mem_cost;
428 extern int load_cost, store_cost, shuffle_cost;
429 extern int move_loops_num, additional_jumps_num;
431 /* Map: register class x machine mode -> number of hard registers of
432 given class needed to store value of given mode. If the number is
433 different, the size will be negative. */
434 extern int reg_class_nregs [N_REG_CLASSES] [MAX_MACHINE_MODE];
436 /* Maximal value of the previous array elements. */
437 extern int max_nregs;
439 /* The number of bits in each element of `allocnos_live' and what
440 type that element has. We use the largest integer format on the
441 host machine. */
442 #define INT_BITS HOST_BITS_PER_WIDE_INT
443 #define INT_TYPE HOST_WIDE_INT
445 /* Set, clear or test bit number I in R, a bit vector indexed by
446 allocno number. */
447 #define SET_ALLOCNO_SET_BIT(R, I) \
448 ((R)[(unsigned) (I) / INT_BITS] \
449 |= ((INT_TYPE) 1 << ((unsigned) (I) % INT_BITS)))
451 #define CLEAR_ALLOCNO_SET_BIT(R, I) \
452 ((R) [(unsigned) (I) / INT_BITS] \
453 &= ~((INT_TYPE) 1 << ((unsigned) (I) % INT_BITS)))
455 #define TEST_ALLOCNO_SET_BIT(R, I) \
456 ((R) [(unsigned) (I) / INT_BITS] \
457 & ((INT_TYPE) 1 << ((unsigned) (I) % INT_BITS)))
459 /* For each allocno set in ALLOCNO_SET, set ALLOCNO to that
460 allocno, and execute CODE. */
461 #define EXECUTE_IF_SET_IN_ALLOCNO_SET(ALLOCNO_SET, ALLOCNO, CODE) \
462 do { \
463 int i_; \
464 int allocno_; \
465 INT_TYPE *p_ = (ALLOCNO_SET); \
467 for (i_ = allocno_set_words - 1, allocno_ = 0; i_ >= 0; \
468 i_--, allocno_ += INT_BITS) \
470 unsigned INT_TYPE word_ = (unsigned INT_TYPE) *p_++; \
472 for ((ALLOCNO) = allocno_; word_; word_ >>= 1, (ALLOCNO)++) \
474 if (word_ & 1) \
475 {CODE;} \
478 } while (0)
480 /* ira.c: */
482 /* Hard regsets whose all bits are correspondingly zero or one. */
483 extern HARD_REG_SET zero_hard_reg_set;
484 extern HARD_REG_SET one_hard_reg_set;
486 /* A mode whose value is immediately contained in given mode
487 value. */
488 extern unsigned char mode_inner_mode [NUM_MACHINE_MODES];
490 /* Map hard regs X modes -> number registers for store value of given
491 mode starting with given hard register. */
492 extern HARD_REG_SET reg_mode_hard_regset
493 [FIRST_PSEUDO_REGISTER] [NUM_MACHINE_MODES];
495 /* Array analog of macros MEMORY_MOVE_COST and REGISTER_MOVE_COST. */
496 extern int memory_move_cost [MAX_MACHINE_MODE] [N_REG_CLASSES] [2];
497 extern int register_move_cost [MAX_MACHINE_MODE] [N_REG_CLASSES]
498 [N_REG_CLASSES];
500 /* Register class subset relation. */
501 extern int class_subset_p [N_REG_CLASSES] [N_REG_CLASSES];
503 /* The biggest class inside of intersection of the two classes. */
504 extern enum reg_class reg_class_subintersect [N_REG_CLASSES] [N_REG_CLASSES];
506 /* Hard registers which can be used for the allocation of given
507 register class. */
508 extern short class_hard_regs [N_REG_CLASSES] [FIRST_PSEUDO_REGISTER];
510 /* The size of the above array for given register class. */
511 extern int class_hard_regs_num [N_REG_CLASSES];
513 /* Index (in class_hard_regs) for given register class and hard
514 register. */
515 extern short class_hard_reg_index [N_REG_CLASSES] [FIRST_PSEUDO_REGISTER];
517 /* Hard registers can not be used for the register allocator. */
518 extern HARD_REG_SET no_alloc_regs;
520 /* Number of class hard registers available for the register
521 allocation for given classes. */
522 extern int available_class_regs [N_REG_CLASSES];
524 /* Array whose values are hard regset of hard registers of given
525 register class whose HARD_REGNO_MODE_OK values are zero. */
526 extern HARD_REG_SET prohibited_class_mode_regs
527 [N_REG_CLASSES] [NUM_MACHINE_MODES];
529 /* Array whose values are hard regset of hard registers for which
530 move of the hard register in given mode into itself is
531 prohibited. */
532 extern HARD_REG_SET prohibited_mode_move_regs [NUM_MACHINE_MODES];
534 /* Number of cover classes. */
535 extern int reg_class_cover_size;
537 /* The array containing cover classes whose hard registers are used
538 for the allocation. */
539 extern enum reg_class reg_class_cover [N_REG_CLASSES];
541 /* The value is number of elements in the subsequent array. */
542 extern int important_classes_num;
544 /* The array containing classes which are subclasses of cover
545 classes. */
546 extern enum reg_class important_classes [N_REG_CLASSES];
548 /* The array containing order numbers of important classes (they are
549 subclasses of cover classes). */
550 extern enum reg_class important_class_nums [N_REG_CLASSES];
552 /* Map of register classes to corresponding cover class containing the
553 given class. */
554 extern enum reg_class class_translate [N_REG_CLASSES];
556 extern void set_non_alloc_regs (int);
557 extern void *ira_allocate (size_t);
558 extern void *ira_reallocate (void *, size_t);
559 extern void ira_free (void *addr);
560 extern bitmap ira_allocate_bitmap (void);
561 extern void ira_free_bitmap (bitmap);
562 extern regset ira_allocate_regset (void);
563 extern void ira_free_regset (regset);
564 extern int hard_reg_not_in_set_p (int, enum machine_mode, HARD_REG_SET);
565 extern void print_disposition (FILE *);
566 extern void debug_disposition (void);
567 extern void debug_class_cover (void);
569 /* Regno invariant flags. */
570 extern int *reg_equiv_invariant_p;
572 /* Regno equivalent constants. */
573 extern rtx *reg_equiv_const;
575 /* ira-build.c */
577 /* The current loop tree node. */
578 extern loop_tree_node_t ira_curr_loop_tree_node;
579 extern allocno_t *ira_curr_regno_allocno_map;
580 extern VEC(rtx, heap) **regno_calls;
582 extern int add_regno_call (int, rtx);
584 extern void traverse_loop_tree (int, loop_tree_node_t,
585 void (*) (loop_tree_node_t),
586 void (*) (loop_tree_node_t));
587 extern allocno_t create_allocno (int, int, loop_tree_node_t);
588 extern void allocate_allocno_conflicts (allocno_t, int);
589 extern int allocno_conflict_index (allocno_t, allocno_t);
590 extern void add_allocno_conflict (allocno_t, allocno_t);
591 extern void print_expanded_allocno (allocno_t);
592 extern allocno_live_range_t create_allocno_live_range (allocno_t, int, int,
593 allocno_live_range_t);
594 extern void finish_allocno_live_range (allocno_live_range_t);
595 extern copy_t create_copy (allocno_t, allocno_t, int, rtx, loop_tree_node_t);
596 extern void add_allocno_copy_to_list (copy_t);
597 extern void swap_allocno_copy_ends_if_necessary (copy_t);
598 extern void remove_allocno_copy_from_list (copy_t);
599 extern copy_t add_allocno_copy (allocno_t, allocno_t, int, rtx,
600 loop_tree_node_t);
602 extern void ira_flattening (int, int);
603 extern int ira_build (int);
604 extern void ira_destroy (void);
606 /* ira-costs.c */
607 extern void init_ira_costs_once (void);
608 extern void finish_ira_costs_once (void);
609 extern void ira_costs (void);
610 extern void tune_allocno_costs_and_cover_classes (void);
612 /* ira-lives.c */
614 /* Number of ints required to hold allocnos_num bits. */
615 extern int allocno_set_words;
617 extern void rebuild_start_finish_chains (void);
618 extern void print_live_range_list (FILE *, allocno_live_range_t);
619 extern void debug_live_range_list (allocno_live_range_t);
620 extern void debug_allocno_live_ranges (allocno_t);
621 extern void debug_live_ranges (void);
622 extern void create_allocno_live_ranges (void);
623 extern void finish_allocno_live_ranges (void);
625 /* ira-conflicts.c */
626 extern int allocno_conflict_p (allocno_t, allocno_t);
627 extern int allocno_reg_conflict_p (int, int);
628 extern void debug_conflicts (int);
629 extern void ira_build_conflicts (void);
631 /* ira-color.c */
632 extern int loop_edge_freq (loop_tree_node_t, int, int);
633 extern void reassign_conflict_allocnos (int, int);
634 extern void ira_color (void);
636 /* ira-emit.c */
637 extern void ira_emit (int);