Commit a4fbe84b by Richard Sandiford Committed by Richard Sandiford

revert: dce.c (deletable_insn_p_1): New function, split out from...

gcc/
	Revert:

	2007-06-27  Richard Sandiford  <richard@codesourcery.com>

	* dce.c (deletable_insn_p_1): New function, split out from...
	(deletable_insn_p): ...here.  Only treat bare USEs and CLOBBERs
	specially, not those inside PARALLELs.  Remove BODY argument
	and adjust recursive call accordingly.
	(prescan_insns_for_dce): Update call to delete_insn_p.

From-SVN: r126143
parent 9d35384d
2007-06-30 Richard Sandiford <richard@codesourcery.com>
Revert:
2007-06-27 Richard Sandiford <richard@codesourcery.com>
* dce.c (deletable_insn_p_1): New function, split out from...
(deletable_insn_p): ...here. Only treat bare USEs and CLOBBERs
specially, not those inside PARALLELs. Remove BODY argument
and adjust recursive call accordingly.
(prescan_insns_for_dce): Update call to delete_insn_p.
2007-06-30 Rask Ingemann Lambertsen <rask@sygehus.dk> 2007-06-30 Rask Ingemann Lambertsen <rask@sygehus.dk>
* combine.c (combine_validate_cost): New parameter NEWOTHERPAT. * combine.c (combine_validate_cost): New parameter NEWOTHERPAT.
......
...@@ -58,15 +58,16 @@ static bitmap_obstack dce_tmp_bitmap_obstack; ...@@ -58,15 +58,16 @@ static bitmap_obstack dce_tmp_bitmap_obstack;
static sbitmap marked = NULL; static sbitmap marked = NULL;
/* A subroutine for which BODY is part of the instruction being tested; /* Return true if INSN with BODY is a normal instruction that can be
either the top-level pattern, or an element of a PARALLEL. The deleted by the DCE pass. */
instruction is known not to be a bare USE or CLOBBER. */
static bool static bool
deletable_insn_p_1 (rtx body) deletable_insn_p (rtx insn, rtx body, bool fast)
{ {
rtx x;
switch (GET_CODE (body)) switch (GET_CODE (body))
{ {
case USE:
case PREFETCH: case PREFETCH:
case TRAP_IF: case TRAP_IF:
/* The UNSPEC case was added here because the ia-64 claims that /* The UNSPEC case was added here because the ia-64 claims that
...@@ -78,35 +79,6 @@ deletable_insn_p_1 (rtx body) ...@@ -78,35 +79,6 @@ deletable_insn_p_1 (rtx body)
case UNSPEC: case UNSPEC:
return false; return false;
default:
if (volatile_insn_p (body))
return false;
if (flag_non_call_exceptions && may_trap_p (body))
return false;
return true;
}
}
/* Return true if INSN is a normal instruction that can be deleted by
the DCE pass. */
static bool
deletable_insn_p (rtx insn, bool fast)
{
rtx body, x;
int i;
if (!NONJUMP_INSN_P (insn))
return false;
body = PATTERN (insn);
switch (GET_CODE (body))
{
case USE:
return false;
case CLOBBER: case CLOBBER:
if (fast) if (fast)
{ {
...@@ -123,13 +95,25 @@ deletable_insn_p (rtx insn, bool fast) ...@@ -123,13 +95,25 @@ deletable_insn_p (rtx insn, bool fast)
return false; return false;
case PARALLEL: case PARALLEL:
{
int i;
for (i = XVECLEN (body, 0) - 1; i >= 0; i--) for (i = XVECLEN (body, 0) - 1; i >= 0; i--)
if (!deletable_insn_p_1 (XVECEXP (body, 0, i))) if (!deletable_insn_p (insn, XVECEXP (body, 0, i), fast))
return false; return false;
return true; return true;
}
default: default:
return deletable_insn_p_1 (body); if (!NONJUMP_INSN_P (insn))
return false;
if (volatile_insn_p (body))
return false;
if (flag_non_call_exceptions && may_trap_p (body))
return false;
return true;
} }
} }
...@@ -385,7 +369,7 @@ prescan_insns_for_dce (bool fast) ...@@ -385,7 +369,7 @@ prescan_insns_for_dce (bool fast)
rtx note = find_reg_note (insn, REG_LIBCALL_ID, NULL_RTX); rtx note = find_reg_note (insn, REG_LIBCALL_ID, NULL_RTX);
if (note) if (note)
mark_libcall (insn, fast); mark_libcall (insn, fast);
else if (deletable_insn_p (insn, fast)) else if (deletable_insn_p (insn, PATTERN (insn), fast))
mark_nonreg_stores (PATTERN (insn), insn, fast); mark_nonreg_stores (PATTERN (insn), insn, fast);
else else
mark_insn (insn, fast); mark_insn (insn, fast);
......
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