From: Steven Bosscher Date: Fri, 30 May 2008 18:28:48 +0000 (+0000) Subject: optabs.c (maybe_encapsulate_block): Remove. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=856905c263d25f1acdc580a3ebfa6111da9868b8;p=gcc.git optabs.c (maybe_encapsulate_block): Remove. 2008-05-30 Steven Bosscher * optabs.c (maybe_encapsulate_block): Remove. (emit_libcall_block): Adjust accordingly. * optabs.h (maybe_encapsulate_block): Remove prototype. * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Don't use maybe_encapsulate_block. From-SVN: r136217 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1a76fd3e7be..d61e4f4eb2d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2008-05-30 Steven Bosscher + + * optabs.c (maybe_encapsulate_block): Remove. + (emit_libcall_block): Adjust accordingly. + * optabs.h (maybe_encapsulate_block): Remove prototype. + + * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): + Don't use maybe_encapsulate_block. + 2008-05-30 Steven Bosscher * config/rs6000/rs6000.c (rs6000_legitimize_address, diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index f91225fe1c8..54b38ce843b 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3890,7 +3890,6 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) emit_insn (gen_addsi3 (tmp3, tmp1, tmp2)); last = emit_move_insn (got, tmp3); set_unique_reg_note (last, REG_EQUAL, gsym); - maybe_encapsulate_block (first, last, gsym); } } } diff --git a/gcc/optabs.c b/gcc/optabs.c index f10b1705dd6..b3517697ff2 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -3829,38 +3829,6 @@ no_conflict_move_test (rtx dest, const_rtx set, void *p0) p->must_stay = true; } -/* Encapsulate the block starting at FIRST and ending with LAST, which is - logically equivalent to EQUIV, so it gets manipulated as a unit if it - is possible to do so. */ - -void -maybe_encapsulate_block (rtx first, rtx last, rtx equiv) -{ - if (!flag_non_call_exceptions || !may_trap_p (equiv)) - { - /* We can't attach the REG_LIBCALL and REG_RETVAL notes when the - encapsulated region would not be in one basic block, i.e. when - there is a control_flow_insn_p insn between FIRST and LAST. */ - bool attach_libcall_retval_notes = true; - rtx insn, next = NEXT_INSN (last); - - for (insn = first; insn != next; insn = NEXT_INSN (insn)) - if (control_flow_insn_p (insn)) - { - attach_libcall_retval_notes = false; - break; - } - - if (attach_libcall_retval_notes) - { - REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last, - REG_NOTES (first)); - REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, - REG_NOTES (last)); - } - } -} - /* Emit code to make a call to a constant function or a library call. @@ -3872,25 +3840,13 @@ maybe_encapsulate_block (rtx first, rtx last, rtx equiv) loading constants into registers; doing so allows them to be safely cse'ed between blocks. Then we emit all the other insns in the block, followed by an insn to move RESULT to TARGET. This last insn will have a REQ_EQUAL - note with an operand of EQUIV. - - Moving assignments to pseudos outside of the block is done to improve - the generated code, but is not required to generate correct code, - hence being unable to move an assignment is not grounds for not making - a libcall block. There are two reasons why it is safe to leave these - insns inside the block: First, we know that these pseudos cannot be - used in generated RTL outside the block since they are created for - temporary purposes within the block. Second, CSE will not record the - values of anything set inside a libcall block, so we know they must - be dead at the end of the block. - - Except for the first group of insns (the ones setting pseudos), the - block is delimited by REG_RETVAL and REG_LIBCALL notes. */ + note with an operand of EQUIV. */ + void emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv) { rtx final_dest = target; - rtx prev, next, first, last, insn; + rtx prev, next, last, insn; /* If this is a reg with REG_USERVAR_P set, then it could possibly turn into a MEM later. Protect the libcall block from this change. */ @@ -3936,14 +3892,6 @@ emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv) for (insn = insns; insn; insn = next) { rtx set = single_set (insn); - rtx note; - - /* Some ports (cris) create a libcall regions at their own. We must - avoid any potential nesting of LIBCALLs. */ - if ((note = find_reg_note (insn, REG_LIBCALL, NULL)) != NULL) - remove_note (insn, note); - if ((note = find_reg_note (insn, REG_RETVAL, NULL)) != NULL) - remove_note (insn, note); next = NEXT_INSN (insn); @@ -3992,25 +3940,9 @@ emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv) if (optab_handler (mov_optab, GET_MODE (target))->insn_code != CODE_FOR_nothing) set_unique_reg_note (last, REG_EQUAL, copy_rtx (equiv)); - else - { - /* Remove any existing REG_EQUAL note from "last", or else it will - be mistaken for a note referring to the full contents of the - libcall value when found together with the REG_RETVAL note added - below. An existing note can come from an insn expansion at - "last". */ - remove_note (last, find_reg_note (last, REG_EQUAL, NULL_RTX)); - } if (final_dest != target) emit_move_insn (final_dest, target); - - if (prev == 0) - first = get_insns (); - else - first = NEXT_INSN (prev); - - maybe_encapsulate_block (first, last, equiv); } /* Nonzero if we can perform a comparison of mode MODE straightforwardly. diff --git a/gcc/optabs.h b/gcc/optabs.h index 0b55c4fc8cc..426b0d845fd 100644 --- a/gcc/optabs.h +++ b/gcc/optabs.h @@ -723,10 +723,6 @@ extern rtx expand_copysign (rtx, rtx, rtx); an input. */ extern void emit_unop_insn (int, rtx, rtx, enum rtx_code); -/* Excapsulate the block in REG_LIBCALL, and REG_RETVAL reg notes and add - REG_LIBCALL_ID notes to all insns in block. */ -extern void maybe_encapsulate_block (rtx, rtx, rtx); - /* Emit one rtl insn to compare two rtx's. */ extern void emit_cmp_insn (rtx, rtx, enum rtx_code, rtx, enum machine_mode, int);