Commit 856905c2 by Steven Bosscher Committed by Kenneth Zadeck

optabs.c (maybe_encapsulate_block): Remove.

2008-05-30  Steven Bosscher  <stevenb.gcc@gmail.com>

	* 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
parent 0cdc04e8
2008-05-30 Steven Bosscher <stevenb.gcc@gmail.com> 2008-05-30 Steven Bosscher <stevenb.gcc@gmail.com>
* 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 <stevenb.gcc@gmail.com>
* config/rs6000/rs6000.c (rs6000_legitimize_address, * config/rs6000/rs6000.c (rs6000_legitimize_address,
rs6000_legitimize_reload_address, rs6000_emit_move): Make sure an rs6000_legitimize_reload_address, rs6000_emit_move): Make sure an
rtx is a SYMBOL_REF before calling get_pool_constant. rtx is a SYMBOL_REF before calling get_pool_constant.
......
...@@ -3890,7 +3890,6 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) ...@@ -3890,7 +3890,6 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
emit_insn (gen_addsi3 (tmp3, tmp1, tmp2)); emit_insn (gen_addsi3 (tmp3, tmp1, tmp2));
last = emit_move_insn (got, tmp3); last = emit_move_insn (got, tmp3);
set_unique_reg_note (last, REG_EQUAL, gsym); set_unique_reg_note (last, REG_EQUAL, gsym);
maybe_encapsulate_block (first, last, gsym);
} }
} }
} }
......
...@@ -3829,38 +3829,6 @@ no_conflict_move_test (rtx dest, const_rtx set, void *p0) ...@@ -3829,38 +3829,6 @@ no_conflict_move_test (rtx dest, const_rtx set, void *p0)
p->must_stay = true; 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. /* 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) ...@@ -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 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 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 an insn to move RESULT to TARGET. This last insn will have a REQ_EQUAL
note with an operand of EQUIV. 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. */
void void
emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv) emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv)
{ {
rtx final_dest = target; 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 /* 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. */ 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) ...@@ -3936,14 +3892,6 @@ emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv)
for (insn = insns; insn; insn = next) for (insn = insns; insn; insn = next)
{ {
rtx set = single_set (insn); 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); next = NEXT_INSN (insn);
...@@ -3992,25 +3940,9 @@ emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv) ...@@ -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 if (optab_handler (mov_optab, GET_MODE (target))->insn_code
!= CODE_FOR_nothing) != CODE_FOR_nothing)
set_unique_reg_note (last, REG_EQUAL, copy_rtx (equiv)); 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) if (final_dest != target)
emit_move_insn (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. /* Nonzero if we can perform a comparison of mode MODE straightforwardly.
......
...@@ -723,10 +723,6 @@ extern rtx expand_copysign (rtx, rtx, rtx); ...@@ -723,10 +723,6 @@ extern rtx expand_copysign (rtx, rtx, rtx);
an input. */ an input. */
extern void emit_unop_insn (int, rtx, rtx, enum rtx_code); 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. */ /* Emit one rtl insn to compare two rtx's. */
extern void emit_cmp_insn (rtx, rtx, enum rtx_code, rtx, enum machine_mode, extern void emit_cmp_insn (rtx, rtx, enum rtx_code, rtx, enum machine_mode,
int); int);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment