comparison gcc/ira-conflicts.c @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents 58ad6c70ea60
children b7f97abdc517
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
150 ALLOCNO_MIN (live_a), 150 ALLOCNO_MIN (live_a),
151 ALLOCNO_MAX (live_a)); 151 ALLOCNO_MAX (live_a));
152 } 152 }
153 } 153 }
154 } 154 }
155 155
156 for (r = ira_finish_point_ranges[i]; r != NULL; r = r->finish_next) 156 for (r = ira_finish_point_ranges[i]; r != NULL; r = r->finish_next)
157 sparseset_clear_bit (allocnos_live, ALLOCNO_NUM (r->allocno)); 157 sparseset_clear_bit (allocnos_live, ALLOCNO_NUM (r->allocno));
158 } 158 }
159 sparseset_free (allocnos_live); 159 sparseset_free (allocnos_live);
160 return true; 160 return true;
233 else if (! ignore_p) 233 else if (! ignore_p)
234 switch (c) 234 switch (c)
235 { 235 {
236 case 'X': 236 case 'X':
237 return -1; 237 return -1;
238 238
239 case 'm': 239 case 'm':
240 case 'o': 240 case 'o':
241 /* Accept a register which might be placed in memory. */ 241 /* Accept a register which might be placed in memory. */
242 return -1; 242 return -1;
243 break; 243 break;
246 case '<': 246 case '<':
247 case '>': 247 case '>':
248 break; 248 break;
249 249
250 case 'p': 250 case 'p':
251 GO_IF_LEGITIMATE_ADDRESS (VOIDmode, op, win_p); 251 if (address_operand (op, VOIDmode))
252 return -1;
252 break; 253 break;
253 254
254 win_p:
255 return -1;
256
257 case 'g': 255 case 'g':
258 return -1; 256 return -1;
259 257
260 case 'r': 258 case 'r':
261 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': 259 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
262 case 'h': case 'j': case 'k': case 'l': 260 case 'h': case 'j': case 'k': case 'l':
263 case 'q': case 't': case 'u': 261 case 'q': case 't': case 'u':
264 case 'v': case 'w': case 'x': case 'y': case 'z': 262 case 'v': case 'w': case 'x': case 'y': case 'z':
276 else if (EXTRA_CONSTRAINT_STR (op, c, str)) 274 else if (EXTRA_CONSTRAINT_STR (op, c, str))
277 return -1; 275 return -1;
278 #endif 276 #endif
279 break; 277 break;
280 } 278 }
281 279
282 case '0': case '1': case '2': case '3': case '4': 280 case '0': case '1': case '2': case '3': case '4':
283 case '5': case '6': case '7': case '8': case '9': 281 case '5': case '6': case '7': case '8': case '9':
284 if (original != -1 && original != c) 282 if (original != -1 && original != c)
285 return -1; 283 return -1;
286 original = c; 284 original = c;
389 { 387 {
390 cp = ira_add_allocno_copy (ira_curr_regno_allocno_map[REGNO (reg1)], 388 cp = ira_add_allocno_copy (ira_curr_regno_allocno_map[REGNO (reg1)],
391 ira_curr_regno_allocno_map[REGNO (reg2)], 389 ira_curr_regno_allocno_map[REGNO (reg2)],
392 freq, constraint_p, insn, 390 freq, constraint_p, insn,
393 ira_curr_loop_tree_node); 391 ira_curr_loop_tree_node);
394 bitmap_set_bit (ira_curr_loop_tree_node->local_copies, cp->num); 392 bitmap_set_bit (ira_curr_loop_tree_node->local_copies, cp->num);
395 return true; 393 return true;
396 } 394 }
397 else 395 else
398 return false; 396 return false;
399 if (! IN_RANGE (allocno_preferenced_hard_regno, 0, FIRST_PSEUDO_REGISTER - 1)) 397 if (! IN_RANGE (allocno_preferenced_hard_regno, 0, FIRST_PSEUDO_REGISTER - 1))
446 444
447 gcc_assert (REG_SUBREG_P (reg)); 445 gcc_assert (REG_SUBREG_P (reg));
448 for (i = 0; i < recog_data.n_operands; i++) 446 for (i = 0; i < recog_data.n_operands; i++)
449 { 447 {
450 another_reg = recog_data.operand[i]; 448 another_reg = recog_data.operand[i];
451 449
452 if (!REG_SUBREG_P (another_reg) || op_num == i 450 if (!REG_SUBREG_P (another_reg) || op_num == i
453 || recog_data.operand_type[i] != OP_OUT) 451 || recog_data.operand_type[i] != OP_OUT)
454 continue; 452 continue;
455 453
456 process_regs_for_copy (reg, another_reg, false, NULL_RTX, freq); 454 process_regs_for_copy (reg, another_reg, false, NULL_RTX, freq);
457 } 455 }
458 } 456 }
459 457
460 /* Process INSN and create allocno copies if necessary. For example, 458 /* Process INSN and create allocno copies if necessary. For example,
465 { 463 {
466 rtx set, operand, dup; 464 rtx set, operand, dup;
467 const char *str; 465 const char *str;
468 bool commut_p, bound_p; 466 bool commut_p, bound_p;
469 int i, j, freq; 467 int i, j, freq;
470 468
471 freq = REG_FREQ_FROM_BB (BLOCK_FOR_INSN (insn)); 469 freq = REG_FREQ_FROM_BB (BLOCK_FOR_INSN (insn));
472 if (freq == 0) 470 if (freq == 0)
473 freq = 1; 471 freq = 1;
474 if ((set = single_set (insn)) != NULL_RTX 472 if ((set = single_set (insn)) != NULL_RTX
475 && REG_SUBREG_P (SET_DEST (set)) && REG_SUBREG_P (SET_SRC (set)) 473 && REG_SUBREG_P (SET_DEST (set)) && REG_SUBREG_P (SET_SRC (set))
489 && find_reg_note (insn, REG_DEAD, 487 && find_reg_note (insn, REG_DEAD,
490 REG_P (operand) 488 REG_P (operand)
491 ? operand : SUBREG_REG (operand)) != NULL_RTX) 489 ? operand : SUBREG_REG (operand)) != NULL_RTX)
492 { 490 {
493 str = recog_data.constraints[i]; 491 str = recog_data.constraints[i];
494 while (*str == ' ' && *str == '\t') 492 while (*str == ' ' || *str == '\t')
495 str++; 493 str++;
496 bound_p = false; 494 bound_p = false;
497 for (j = 0, commut_p = false; j < 2; j++, commut_p = true) 495 for (j = 0, commut_p = false; j < 2; j++, commut_p = true)
498 if ((dup = get_dup (i, commut_p)) != NULL_RTX 496 if ((dup = get_dup (i, commut_p)) != NULL_RTX
499 && REG_SUBREG_P (dup) 497 && REG_SUBREG_P (dup)
522 520
523 bb = loop_tree_node->bb; 521 bb = loop_tree_node->bb;
524 if (bb == NULL) 522 if (bb == NULL)
525 return; 523 return;
526 FOR_BB_INSNS (bb, insn) 524 FOR_BB_INSNS (bb, insn)
527 if (INSN_P (insn)) 525 if (NONDEBUG_INSN_P (insn))
528 add_insn_allocno_copies (insn); 526 add_insn_allocno_copies (insn);
529 } 527 }
530 528
531 /* Propagate copies the corresponding allocnos on upper loop tree 529 /* Propagate copies the corresponding allocnos on upper loop tree
532 level. */ 530 level. */
662 static void 660 static void
663 print_hard_reg_set (FILE *file, const char *title, HARD_REG_SET set) 661 print_hard_reg_set (FILE *file, const char *title, HARD_REG_SET set)
664 { 662 {
665 int i, start; 663 int i, start;
666 664
667 fprintf (file, title); 665 fputs (title, file);
668 for (start = -1, i = 0; i < FIRST_PSEUDO_REGISTER; i++) 666 for (start = -1, i = 0; i < FIRST_PSEUDO_REGISTER; i++)
669 { 667 {
670 if (TEST_HARD_REG_BIT (set, i)) 668 if (TEST_HARD_REG_BIT (set, i))
671 { 669 {
672 if (i == 0 || ! TEST_HARD_REG_BIT (set, i - 1)) 670 if (i == 0 || ! TEST_HARD_REG_BIT (set, i - 1))
682 else 680 else
683 fprintf (file, " %d-%d", start, i - 1); 681 fprintf (file, " %d-%d", start, i - 1);
684 start = -1; 682 start = -1;
685 } 683 }
686 } 684 }
687 fprintf (file, "\n"); 685 putc ('\n', file);
688 } 686 }
689 687
690 /* Print information about allocno or only regno (if REG_P) conflicts 688 /* Print information about allocno or only regno (if REG_P) conflicts
691 to FILE. */ 689 to FILE. */
692 static void 690 static void
709 fprintf (file, ";; a%d(r%d,", ALLOCNO_NUM (a), ALLOCNO_REGNO (a)); 707 fprintf (file, ";; a%d(r%d,", ALLOCNO_NUM (a), ALLOCNO_REGNO (a));
710 if ((bb = ALLOCNO_LOOP_TREE_NODE (a)->bb) != NULL) 708 if ((bb = ALLOCNO_LOOP_TREE_NODE (a)->bb) != NULL)
711 fprintf (file, "b%d", bb->index); 709 fprintf (file, "b%d", bb->index);
712 else 710 else
713 fprintf (file, "l%d", ALLOCNO_LOOP_TREE_NODE (a)->loop->num); 711 fprintf (file, "l%d", ALLOCNO_LOOP_TREE_NODE (a)->loop->num);
714 fprintf (file, ")"); 712 putc (')', file);
715 } 713 }
716 fprintf (file, " conflicts:"); 714 fputs (" conflicts:", file);
717 if (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) != NULL) 715 if (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) != NULL)
718 FOR_EACH_ALLOCNO_CONFLICT (a, conflict_a, aci) 716 FOR_EACH_ALLOCNO_CONFLICT (a, conflict_a, aci)
719 { 717 {
720 if (reg_p) 718 if (reg_p)
721 fprintf (file, " r%d,", ALLOCNO_REGNO (conflict_a)); 719 fprintf (file, " r%d,", ALLOCNO_REGNO (conflict_a));
743 AND_HARD_REG_SET (conflicting_hard_regs, 741 AND_HARD_REG_SET (conflicting_hard_regs,
744 reg_class_contents[ALLOCNO_COVER_CLASS (a)]); 742 reg_class_contents[ALLOCNO_COVER_CLASS (a)]);
745 print_hard_reg_set (file, ";; conflict hard regs:", 743 print_hard_reg_set (file, ";; conflict hard regs:",
746 conflicting_hard_regs); 744 conflicting_hard_regs);
747 } 745 }
748 fprintf (file, "\n"); 746 putc ('\n', file);
749 } 747 }
750 748
751 /* Print information about allocno or only regno (if REG_P) conflicts 749 /* Print information about allocno or only regno (if REG_P) conflicts
752 to stderr. */ 750 to stderr. */
753 void 751 void