From: Richard Henderson Date: Fri, 27 Oct 2000 21:27:10 +0000 (-0700) Subject: ia64.c: Revert 10-23 patch. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=10c9f189d4c0730eb59e940edb462b58f58c8457;p=gcc.git ia64.c: Revert 10-23 patch. * config/ia64/ia64.c: Revert 10-23 patch. (ia64_hard_regno_rename_ok): New. * config/ia64/ia64-protos.h: Declare it. * config/ia64/ia64.h (HARD_REGNO_RENAME_OK): Use it. From-SVN: r37090 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fbb52e6772f..39e1ff39ac8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2000-10-27 Richard Henderson + + * config/ia64/ia64.c: Revert 10-23 patch. + (ia64_hard_regno_rename_ok): New. + * config/ia64/ia64-protos.h: Declare it. + * config/ia64/ia64.h (HARD_REGNO_RENAME_OK): Use it. + 2000-10-27 Bernd Schmidt Richard Henderson diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h index 839648cdf2c..fc1dff1091f 100644 --- a/gcc/config/ia64/ia64-protos.h +++ b/gcc/config/ia64/ia64-protos.h @@ -82,6 +82,7 @@ extern void ia64_function_epilogue PARAMS((FILE *, int)); extern int ia64_direct_return PARAMS((void)); extern void ia64_expand_load_address PARAMS((rtx, rtx)); +extern int ia64_hard_regno_rename_ok PARAMS((int, int)); extern void ia64_initialize_trampoline PARAMS((rtx, rtx, rtx)); extern void ia64_print_operand_address PARAMS((FILE *, rtx)); diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index dcf3ce17ff7..6790d3f3ab4 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -1852,12 +1852,6 @@ ia64_expand_prologue () reg_names[OUT_REG (i)] = ia64_reg_numbers[inputs + locals + i]; } - /* ??? Temporarily mark the remaining output registers fixed, so - that the register renaming pass does not try to used them after - we've fixed the size of the register frame. */ - for (i = current_frame_info.n_output_regs; i < 8; ++i) - fixed_regs[OUT_REG (i)] = 1; - /* Set the frame pointer register name. The regnum is logically loc79, but of course we'll not have allocated that many locals. Rather than worrying about renumbering the existing rtxs, we adjust the name. */ @@ -2393,6 +2387,31 @@ ia64_direct_return () return 0; } +int +ia64_hard_regno_rename_ok (from, to) + int from; + int to; +{ + /* Don't clobber any of the registers we reserved for the prologue. */ + if (to == current_frame_info.reg_fp + || to == current_frame_info.reg_save_b0 + || to == current_frame_info.reg_save_pr + || to == current_frame_info.reg_save_ar_pfs + || to == current_frame_info.reg_save_ar_unat + || to == current_frame_info.reg_save_ar_lc) + return 0; + + /* Don't use output registers outside the register frame. */ + if (OUT_REGNO_P (to) && to >= OUT_REG (current_frame_info.n_output_regs)) + return 0; + + /* Retain even/oddness on predicate register pairs. */ + if (PR_REGNO_P (from) && PR_REGNO_P (to)) + return (from & 1) == (to & 1); + + return 1; +} + /* Emit the function prologue. */ void @@ -2503,9 +2522,6 @@ ia64_function_epilogue (file, size) reg_names[OUT_REG (i)] = ia64_output_reg_names[i]; } - for (i = 0; i < 8; ++i) - fixed_regs[OUT_REG (i)] = 0; - current_frame_info.initialized = 0; } diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index 9fd78f8317b..7802e390550 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -2643,11 +2643,7 @@ do { \ considered for use as a rename register for REGNO1 */ #define HARD_REGNO_RENAME_OK(REGNO1,REGNO2) \ - ((! PR_REGNO_P (REGNO1) && ! PR_REGNO_P (REGNO2)) \ - ? (!call_fixed_regs [REGNO1] && !call_fixed_regs [REGNO2]) \ - ? 1 : 0 \ - : ((REGNO2) > 256 && ((REGNO2 & 1) == 0)) \ - ? 1 : 0) + ia64_hard_regno_rename_ok((REGNO1), (REGNO2)) /* Define this macro if the compiler should use extended basic blocks when renaming registers. Define this macro if the target has predicate