00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "config.h"
00022 #include "system.h"
00023 #include "rtl.h"
00024 #include "tm_p.h"
00025 #include "insn-config.h"
00026 #include "recog.h"
00027 #include "reload.h"
00028 #include "integrate.h"
00029 #include "function.h"
00030 #include "regs.h"
00031 #include "obstack.h"
00032 #include "hard-reg-set.h"
00033 #include "basic-block.h"
00034 #include "df.h"
00035 #include "expr.h"
00036 #include "output.h"
00037 #include "toplev.h"
00038 #include "flags.h"
00039 #include "ra.h"
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 static struct obstack ra_obstack;
00086 static void create_insn_info PARAMS ((struct df *));
00087 static void free_insn_info PARAMS ((void));
00088 static void alloc_mem PARAMS ((struct df *));
00089 static void free_mem PARAMS ((struct df *));
00090 static void free_all_mem PARAMS ((struct df *df));
00091 static int one_pass PARAMS ((struct df *, int));
00092 static void check_df PARAMS ((struct df *));
00093 static void init_ra PARAMS ((void));
00094
00095 void reg_alloc PARAMS ((void));
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 sbitmap igraph;
00106 sbitmap sup_igraph;
00107
00108
00109
00110
00111
00112 sbitmap insns_with_deaths;
00113 int death_insns_max_uid;
00114
00115 struct web_part *web_parts;
00116
00117 unsigned int num_webs;
00118 unsigned int num_subwebs;
00119 unsigned int num_allwebs;
00120 struct web **id2web;
00121 struct web *hardreg2web[FIRST_PSEUDO_REGISTER];
00122 struct web **def2web;
00123 struct web **use2web;
00124 struct move_list *wl_moves;
00125 int ra_max_regno;
00126 short *ra_reg_renumber;
00127 struct df *df;
00128 bitmap *live_at_end;
00129 int ra_pass;
00130 unsigned int max_normal_pseudo;
00131 int an_unusable_color;
00132
00133
00134 struct dlist *web_lists[(int) LAST_NODE_TYPE];
00135
00136 unsigned int last_def_id;
00137 unsigned int last_use_id;
00138 unsigned int last_num_webs;
00139 int last_max_uid;
00140 sbitmap last_check_uses;
00141 unsigned int remember_conflicts;
00142
00143 int orig_max_uid;
00144
00145 HARD_REG_SET never_use_colors;
00146 HARD_REG_SET usable_regs[N_REG_CLASSES];
00147 unsigned int num_free_regs[N_REG_CLASSES];
00148 HARD_REG_SET hardregs_for_mode[NUM_MACHINE_MODES];
00149 unsigned char byte2bitcount[256];
00150
00151 unsigned int debug_new_regalloc = -1;
00152 int flag_ra_biased = 0;
00153 int flag_ra_improved_spilling = 0;
00154 int flag_ra_ir_spilling = 0;
00155 int flag_ra_optimistic_coalescing = 0;
00156 int flag_ra_break_aliases = 0;
00157 int flag_ra_merge_spill_costs = 0;
00158 int flag_ra_spill_every_use = 0;
00159 int flag_ra_dump_notes = 0;
00160
00161
00162
00163
00164 void *
00165 ra_alloc (size)
00166 size_t size;
00167 {
00168 return obstack_alloc (&ra_obstack, size);
00169 }
00170
00171
00172
00173 void *
00174 ra_calloc (size)
00175 size_t size;
00176 {
00177 void *p = obstack_alloc (&ra_obstack, size);
00178 memset (p, 0, size);
00179 return p;
00180 }
00181
00182
00183
00184 int
00185 hard_regs_count (rs)
00186 HARD_REG_SET rs;
00187 {
00188 int count = 0;
00189 #ifdef HARD_REG_SET
00190 while (rs)
00191 {
00192 unsigned char byte = rs & 0xFF;
00193 rs >>= 8;
00194
00195 if (byte)
00196 count += byte2bitcount[byte];
00197 }
00198 #else
00199 unsigned int ofs;
00200 for (ofs = 0; ofs < HARD_REG_SET_LONGS; ofs++)
00201 {
00202 HARD_REG_ELT_TYPE elt = rs[ofs];
00203 while (elt)
00204 {
00205 unsigned char byte = elt & 0xFF;
00206 elt >>= 8;
00207 if (byte)
00208 count += byte2bitcount[byte];
00209 }
00210 }
00211 #endif
00212 return count;
00213 }
00214
00215
00216
00217
00218
00219 rtx
00220 ra_emit_move_insn (x, y)
00221 rtx x, y;
00222 {
00223 enum machine_mode mode = GET_MODE (x);
00224 if (GET_MODE_CLASS (mode) == MODE_CC)
00225 return emit_insn (gen_move_insn (x, y));
00226 else
00227 return emit_move_insn (x, y);
00228 }
00229
00230 int insn_df_max_uid;
00231 struct ra_insn_info *insn_df;
00232 static struct ref **refs_for_insn_df;
00233
00234
00235
00236
00237 static void
00238 create_insn_info (df)
00239 struct df *df;
00240 {
00241 rtx insn;
00242 struct ref **act_refs;
00243 insn_df_max_uid = get_max_uid ();
00244 insn_df = xcalloc (insn_df_max_uid, sizeof (insn_df[0]));
00245 refs_for_insn_df = xcalloc (df->def_id + df->use_id, sizeof (struct ref *));
00246 act_refs = refs_for_insn_df;
00247
00248
00249 for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
00250 {
00251 int uid = INSN_UID (insn);
00252 unsigned int n;
00253 struct df_link *link;
00254 if (!INSN_P (insn))
00255 continue;
00256 for (n = 0, link = DF_INSN_DEFS (df, insn); link; link = link->next)
00257 if (link->ref
00258 && (DF_REF_REGNO (link->ref) >= FIRST_PSEUDO_REGISTER
00259 || !TEST_HARD_REG_BIT (never_use_colors,
00260 DF_REF_REGNO (link->ref))))
00261 {
00262 if (n == 0)
00263 insn_df[uid].defs = act_refs;
00264 insn_df[uid].defs[n++] = link->ref;
00265 }
00266 act_refs += n;
00267 insn_df[uid].num_defs = n;
00268 for (n = 0, link = DF_INSN_USES (df, insn); link; link = link->next)
00269 if (link->ref
00270 && (DF_REF_REGNO (link->ref) >= FIRST_PSEUDO_REGISTER
00271 || !TEST_HARD_REG_BIT (never_use_colors,
00272 DF_REF_REGNO (link->ref))))
00273 {
00274 if (n == 0)
00275 insn_df[uid].uses = act_refs;
00276 insn_df[uid].uses[n++] = link->ref;
00277 }
00278 act_refs += n;
00279 insn_df[uid].num_uses = n;
00280 }
00281 if (refs_for_insn_df + (df->def_id + df->use_id) < act_refs)
00282 abort ();
00283 }
00284
00285
00286
00287 static void
00288 free_insn_info ()
00289 {
00290 free (refs_for_insn_df);
00291 refs_for_insn_df = NULL;
00292 free (insn_df);
00293 insn_df = NULL;
00294 insn_df_max_uid = 0;
00295 }
00296
00297
00298
00299
00300
00301 struct web *
00302 find_subweb (web, reg)
00303 struct web *web;
00304 rtx reg;
00305 {
00306 struct web *w;
00307 if (GET_CODE (reg) != SUBREG)
00308 abort ();
00309 for (w = web->subreg_next; w; w = w->subreg_next)
00310 if (GET_MODE (w->orig_x) == GET_MODE (reg)
00311 && SUBREG_BYTE (w->orig_x) == SUBREG_BYTE (reg))
00312 return w;
00313 return NULL;
00314 }
00315
00316
00317
00318
00319 struct web *
00320 find_subweb_2 (web, size_word)
00321 struct web *web;
00322 unsigned int size_word;
00323 {
00324 struct web *w = web;
00325 if (size_word == GET_MODE_SIZE (GET_MODE (web->orig_x)))
00326
00327 return web;
00328 for (w = web->subreg_next; w; w = w->subreg_next)
00329 {
00330 unsigned int bl = rtx_to_bits (w->orig_x);
00331 if (size_word == bl)
00332 return w;
00333 }
00334 return NULL;
00335 }
00336
00337
00338
00339 struct web *
00340 find_web_for_subweb_1 (subweb)
00341 struct web *subweb;
00342 {
00343 while (subweb->parent_web)
00344 subweb = subweb->parent_web;
00345 return subweb;
00346 }
00347
00348
00349
00350
00351 int
00352 hard_regs_intersect_p (a, b)
00353 HARD_REG_SET *a, *b;
00354 {
00355 HARD_REG_SET c;
00356 COPY_HARD_REG_SET (c, *a);
00357 AND_HARD_REG_SET (c, *b);
00358 GO_IF_HARD_REG_SUBSET (c, reg_class_contents[(int) NO_REGS], lose);
00359 return 1;
00360 lose:
00361 return 0;
00362 }
00363
00364
00365
00366
00367 static void
00368 alloc_mem (df)
00369 struct df *df;
00370 {
00371 int i;
00372 ra_build_realloc (df);
00373 if (!live_at_end)
00374 {
00375 live_at_end = (bitmap *) xmalloc ((last_basic_block + 2)
00376 * sizeof (bitmap));
00377 for (i = 0; i < last_basic_block + 2; i++)
00378 live_at_end[i] = BITMAP_XMALLOC ();
00379 live_at_end += 2;
00380 }
00381 create_insn_info (df);
00382 }
00383
00384
00385
00386 static void
00387 free_mem (df)
00388 struct df *df ATTRIBUTE_UNUSED;
00389 {
00390 free_insn_info ();
00391 ra_build_free ();
00392 }
00393
00394
00395
00396
00397 static void
00398 free_all_mem (df)
00399 struct df *df;
00400 {
00401 unsigned int i;
00402 live_at_end -= 2;
00403 for (i = 0; i < (unsigned)last_basic_block + 2; i++)
00404 BITMAP_XFREE (live_at_end[i]);
00405 free (live_at_end);
00406
00407 ra_colorize_free_all ();
00408 ra_build_free_all (df);
00409 obstack_free (&ra_obstack, NULL);
00410 }
00411
00412 static long ticks_build;
00413 static long ticks_rebuild;
00414
00415
00416
00417
00418 static int
00419 one_pass (df, rebuild)
00420 struct df *df;
00421 int rebuild;
00422 {
00423 long ticks = clock ();
00424 int something_spilled;
00425 remember_conflicts = 0;
00426
00427
00428
00429 build_i_graph (df);
00430
00431
00432
00433 remember_conflicts = 1;
00434 if (!rebuild)
00435 dump_igraph_machine ();
00436
00437
00438
00439
00440 ra_colorize_graph (df);
00441
00442 last_max_uid = get_max_uid ();
00443
00444
00445 something_spilled = !!WEBS(SPILLED);
00446
00447
00448 if (something_spilled)
00449 actual_spill ();
00450
00451 ticks = clock () - ticks;
00452 if (rebuild)
00453 ticks_rebuild += ticks;
00454 else
00455 ticks_build += ticks;
00456 return something_spilled;
00457 }
00458
00459
00460
00461 static void
00462 init_ra ()
00463 {
00464 int i;
00465 HARD_REG_SET rs;
00466 #ifdef ELIMINABLE_REGS
00467 static const struct {const int from, to; } eliminables[] = ELIMINABLE_REGS;
00468 unsigned int j;
00469 #endif
00470 int need_fp
00471 = (! flag_omit_frame_pointer
00472 #ifdef EXIT_IGNORE_STACK
00473 || (current_function_calls_alloca && EXIT_IGNORE_STACK)
00474 #endif
00475 || FRAME_POINTER_REQUIRED);
00476
00477 ra_colorize_init ();
00478
00479
00480 COPY_HARD_REG_SET (never_use_colors, fixed_reg_set);
00481
00482
00483
00484
00485
00486 #ifdef ELIMINABLE_REGS
00487 for (j = 0; j < ARRAY_SIZE (eliminables); j++)
00488 {
00489 if (! CAN_ELIMINATE (eliminables[j].from, eliminables[j].to)
00490 || (eliminables[j].to == STACK_POINTER_REGNUM && need_fp))
00491 for (i = HARD_REGNO_NREGS (eliminables[j].from, Pmode); i--;)
00492 SET_HARD_REG_BIT (never_use_colors, eliminables[j].from + i);
00493 }
00494 #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
00495 if (need_fp)
00496 for (i = HARD_REGNO_NREGS (HARD_FRAME_POINTER_REGNUM, Pmode); i--;)
00497 SET_HARD_REG_BIT (never_use_colors, HARD_FRAME_POINTER_REGNUM + i);
00498 #endif
00499
00500 #else
00501 if (need_fp)
00502 for (i = HARD_REGNO_NREGS (FRAME_POINTER_REGNUM, Pmode); i--;)
00503 SET_HARD_REG_BIT (never_use_colors, FRAME_POINTER_REGNUM + i);
00504 #endif
00505
00506
00507 for (i = HARD_REGNO_NREGS (STACK_POINTER_REGNUM, Pmode); i--;)
00508 SET_HARD_REG_BIT (never_use_colors, STACK_POINTER_REGNUM + i);
00509
00510 for (i = HARD_REGNO_NREGS (ARG_POINTER_REGNUM, Pmode); i--;)
00511 SET_HARD_REG_BIT (never_use_colors, ARG_POINTER_REGNUM + i);
00512
00513 for (i = 0; i < 256; i++)
00514 {
00515 unsigned char byte = ((unsigned) i) & 0xFF;
00516 unsigned char count = 0;
00517 while (byte)
00518 {
00519 if (byte & 1)
00520 count++;
00521 byte >>= 1;
00522 }
00523 byte2bitcount[i] = count;
00524 }
00525
00526 for (i = 0; i < N_REG_CLASSES; i++)
00527 {
00528 int size;
00529 COPY_HARD_REG_SET (rs, reg_class_contents[i]);
00530 AND_COMPL_HARD_REG_SET (rs, never_use_colors);
00531 size = hard_regs_count (rs);
00532 num_free_regs[i] = size;
00533 COPY_HARD_REG_SET (usable_regs[i], rs);
00534 }
00535
00536
00537
00538
00539
00540 for (i = 0; i < NUM_MACHINE_MODES; i++)
00541 {
00542 int reg, size;
00543 CLEAR_HARD_REG_SET (rs);
00544 for (reg = 0; reg < FIRST_PSEUDO_REGISTER; reg++)
00545 if (HARD_REGNO_MODE_OK (reg, i)
00546
00547 && (size = HARD_REGNO_NREGS (reg, i)) != 0
00548 && (reg + size) <= FIRST_PSEUDO_REGISTER)
00549 {
00550 while (size--)
00551 SET_HARD_REG_BIT (rs, reg + size);
00552 }
00553 COPY_HARD_REG_SET (hardregs_for_mode[i], rs);
00554 }
00555
00556 for (an_unusable_color = 0; an_unusable_color < FIRST_PSEUDO_REGISTER;
00557 an_unusable_color++)
00558 if (TEST_HARD_REG_BIT (never_use_colors, an_unusable_color))
00559 break;
00560 if (an_unusable_color == FIRST_PSEUDO_REGISTER)
00561 abort ();
00562
00563 orig_max_uid = get_max_uid ();
00564 compute_bb_for_insn ();
00565 ra_reg_renumber = NULL;
00566 insns_with_deaths = sbitmap_alloc (orig_max_uid);
00567 death_insns_max_uid = orig_max_uid;
00568 sbitmap_ones (insns_with_deaths);
00569 gcc_obstack_init (&ra_obstack);
00570 }
00571
00572
00573
00574
00575 static void
00576 check_df (df)
00577 struct df *df;
00578 {
00579 struct df_link *link;
00580 rtx insn;
00581 int regno;
00582 unsigned int ui;
00583 bitmap b = BITMAP_XMALLOC ();
00584 bitmap empty_defs = BITMAP_XMALLOC ();
00585 bitmap empty_uses = BITMAP_XMALLOC ();
00586
00587
00588
00589 for (ui = 0; ui < df->def_id; ui++)
00590 if (!df->defs[ui])
00591 bitmap_set_bit (empty_defs, ui);
00592 for (ui = 0; ui < df->use_id; ui++)
00593 if (!df->uses[ui])
00594 bitmap_set_bit (empty_uses, ui);
00595
00596
00597
00598
00599 for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
00600 if (INSN_P (insn))
00601 {
00602 bitmap_clear (b);
00603 for (link = DF_INSN_DEFS (df, insn); link; link = link->next)
00604 if (!link->ref || bitmap_bit_p (empty_defs, DF_REF_ID (link->ref))
00605 || bitmap_bit_p (b, DF_REF_ID (link->ref)))
00606 abort ();
00607 else
00608 bitmap_set_bit (b, DF_REF_ID (link->ref));
00609
00610 bitmap_clear (b);
00611 for (link = DF_INSN_USES (df, insn); link; link = link->next)
00612 if (!link->ref || bitmap_bit_p (empty_uses, DF_REF_ID (link->ref))
00613 || bitmap_bit_p (b, DF_REF_ID (link->ref)))
00614 abort ();
00615 else
00616 bitmap_set_bit (b, DF_REF_ID (link->ref));
00617 }
00618
00619
00620 for (regno = 0; regno < max_reg_num (); regno++)
00621 {
00622 bitmap_clear (b);
00623 for (link = df->regs[regno].defs; link; link = link->next)
00624 if (!link->ref || bitmap_bit_p (empty_defs, DF_REF_ID (link->ref))
00625 || bitmap_bit_p (b, DF_REF_ID (link->ref)))
00626 abort ();
00627 else
00628 bitmap_set_bit (b, DF_REF_ID (link->ref));
00629
00630 bitmap_clear (b);
00631 for (link = df->regs[regno].uses; link; link = link->next)
00632 if (!link->ref || bitmap_bit_p (empty_uses, DF_REF_ID (link->ref))
00633 || bitmap_bit_p (b, DF_REF_ID (link->ref)))
00634 abort ();
00635 else
00636 bitmap_set_bit (b, DF_REF_ID (link->ref));
00637 }
00638
00639 BITMAP_XFREE (empty_uses);
00640 BITMAP_XFREE (empty_defs);
00641 BITMAP_XFREE (b);
00642 }
00643
00644
00645
00646 void
00647 reg_alloc ()
00648 {
00649 int changed;
00650 FILE *ra_dump_file = rtl_dump_file;
00651 rtx last = get_last_insn ();
00652
00653 if (! INSN_P (last))
00654 last = prev_real_insn (last);
00655
00656
00657
00658
00659
00660 if (last)
00661 {
00662 edge e;
00663 for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
00664 {
00665 basic_block bb = e->src;
00666 last = bb->end;
00667 if (!INSN_P (last) || GET_CODE (PATTERN (last)) != USE)
00668 {
00669 rtx insns;
00670 start_sequence ();
00671 use_return_register ();
00672 insns = get_insns ();
00673 end_sequence ();
00674 emit_insn_after (insns, last);
00675 }
00676 }
00677 }
00678
00679
00680 switch (0)
00681 {
00682
00683 case 0: debug_new_regalloc = DUMP_EVER; break;
00684 case 1: debug_new_regalloc = DUMP_COSTS; break;
00685 case 2: debug_new_regalloc = DUMP_IGRAPH_M; break;
00686 case 3: debug_new_regalloc = DUMP_COLORIZE + DUMP_COSTS; break;
00687 case 4: debug_new_regalloc = DUMP_COLORIZE + DUMP_COSTS + DUMP_WEBS;
00688 break;
00689 case 5: debug_new_regalloc = DUMP_FINAL_RTL + DUMP_COSTS +
00690 DUMP_CONSTRAINTS;
00691 break;
00692 case 6: debug_new_regalloc = DUMP_VALIDIFY; break;
00693 }
00694 if (!rtl_dump_file)
00695 debug_new_regalloc = 0;
00696
00697
00698
00699
00700 if ((debug_new_regalloc & DUMP_REGCLASS) == 0)
00701 rtl_dump_file = NULL;
00702 regclass (get_insns (), max_reg_num (), rtl_dump_file);
00703 rtl_dump_file = ra_dump_file;
00704
00705
00706
00707 count_or_remove_death_notes (NULL, 1);
00708
00709
00710 init_ra ();
00711
00712
00713 ra_pass = 0;
00714 no_new_pseudos = 0;
00715 max_normal_pseudo = (unsigned) max_reg_num ();
00716 ra_rewrite_init ();
00717 last_def_id = 0;
00718 last_use_id = 0;
00719 last_num_webs = 0;
00720 last_max_uid = 0;
00721 last_check_uses = NULL;
00722 live_at_end = NULL;
00723 WEBS(INITIAL) = NULL;
00724 WEBS(FREE) = NULL;
00725 memset (hardreg2web, 0, sizeof (hardreg2web));
00726 ticks_build = ticks_rebuild = 0;
00727
00728
00729
00730 flag_ra_biased = 0;
00731 flag_ra_spill_every_use = 0;
00732 flag_ra_improved_spilling = 1;
00733 flag_ra_ir_spilling = 1;
00734 flag_ra_break_aliases = 0;
00735 flag_ra_optimistic_coalescing = 1;
00736 flag_ra_merge_spill_costs = 1;
00737 if (flag_ra_optimistic_coalescing)
00738 flag_ra_break_aliases = 1;
00739 flag_ra_dump_notes = 0;
00740
00741
00742 df = df_init ();
00743
00744
00745
00746 do
00747 {
00748 ra_debug_msg (DUMP_NEARLY_EVER, "RegAlloc Pass %d\n\n", ra_pass);
00749 if (ra_pass++ > 40)
00750 internal_error ("Didn't find a coloring.\n");
00751
00752
00753
00754
00755 df_analyse (df, (ra_pass == 1) ? 0 : (bitmap) -1,
00756 DF_HARD_REGS | DF_RD_CHAIN | DF_RU_CHAIN);
00757
00758 if ((debug_new_regalloc & DUMP_DF) != 0)
00759 {
00760 rtx insn;
00761 df_dump (df, DF_HARD_REGS, rtl_dump_file);
00762 for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
00763 if (INSN_P (insn))
00764 df_insn_debug_regno (df, insn, rtl_dump_file);
00765 }
00766 check_df (df);
00767
00768
00769
00770 alloc_mem (df);
00771
00772
00773
00774 changed = one_pass (df, ra_pass > 1);
00775
00776
00777 if (!changed)
00778 {
00779
00780 emit_colors (df);
00781
00782
00783
00784
00785
00786
00787 setup_renumber (0);
00788
00789 delete_moves ();
00790 dump_constraints ();
00791 }
00792 else
00793 {
00794
00795
00796
00797 if ((debug_new_regalloc & DUMP_REGCLASS) == 0)
00798 rtl_dump_file = NULL;
00799
00800 allocate_reg_info (max_reg_num (), FALSE, FALSE);
00801
00802 compute_bb_for_insn ();
00803
00804 delete_trivially_dead_insns (get_insns (), max_reg_num ());
00805
00806 reg_scan_update (get_insns (), NULL, max_regno);
00807 max_regno = max_reg_num ();
00808
00809 regclass (get_insns (), max_reg_num (), rtl_dump_file);
00810 rtl_dump_file = ra_dump_file;
00811
00812
00813
00814 last_def_id = df->def_id;
00815 last_use_id = df->use_id;
00816 }
00817
00818
00819 dump_ra (df);
00820 if (changed && (debug_new_regalloc & DUMP_RTL) != 0)
00821 {
00822 ra_print_rtl_with_bb (rtl_dump_file, get_insns ());
00823 fflush (rtl_dump_file);
00824 }
00825
00826
00827 reset_lists ();
00828 free_mem (df);
00829 }
00830 while (changed);
00831
00832
00833
00834 free_all_mem (df);
00835 df_finish (df);
00836 if ((debug_new_regalloc & DUMP_RESULTS) == 0)
00837 dump_cost (DUMP_COSTS);
00838 ra_debug_msg (DUMP_COSTS, "ticks for build-phase: %ld\n", ticks_build);
00839 ra_debug_msg (DUMP_COSTS, "ticks for rebuild-phase: %ld\n", ticks_rebuild);
00840 if ((debug_new_regalloc & (DUMP_FINAL_RTL | DUMP_RTL)) != 0)
00841 ra_print_rtl_with_bb (rtl_dump_file, get_insns ());
00842
00843
00844 if ((debug_new_regalloc & DUMP_SM) == 0)
00845 rtl_dump_file = NULL;
00846 no_new_pseudos = 0;
00847 allocate_reg_info (max_reg_num (), FALSE, FALSE);
00848 no_new_pseudos = 1;
00849 rtl_dump_file = ra_dump_file;
00850
00851
00852
00853
00854 fixup_abnormal_edges ();
00855
00856
00857 if ((debug_new_regalloc & DUMP_LAST_FLOW) == 0)
00858 rtl_dump_file = NULL;
00859 life_analysis (get_insns (), rtl_dump_file,
00860 PROP_DEATH_NOTES | PROP_LOG_LINKS | PROP_REG_INFO);
00861 cleanup_cfg (CLEANUP_EXPENSIVE);
00862 recompute_reg_usage (get_insns (), TRUE);
00863 if (rtl_dump_file)
00864 dump_flow_info (rtl_dump_file);
00865 rtl_dump_file = ra_dump_file;
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877 setup_renumber (1);
00878 sbitmap_free (insns_with_deaths);
00879
00880
00881
00882 remove_suspicious_death_notes ();
00883
00884 if ((debug_new_regalloc & DUMP_LAST_RTL) != 0)
00885 ra_print_rtl_with_bb (rtl_dump_file, get_insns ());
00886 dump_static_insn_cost (rtl_dump_file,
00887 "after allocation/spilling, before reload", NULL);
00888
00889
00890 reg_equiv_memory_loc = (rtx *) xcalloc (max_regno, sizeof (rtx));
00891
00892 allocate_initial_values (reg_equiv_memory_loc);
00893
00894 regclass (get_insns (), max_reg_num (), rtl_dump_file);
00895 }
00896
00897
00898
00899