/* Definitions for computing resource usage of specific insns.
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009 Free Software Foundation, Inc.
This file is part of GCC.
void
mark_referenced_resources (rtx x, struct resources *res,
- int include_delayed_effects)
+ bool include_delayed_effects)
{
enum rtx_code code = GET_CODE (x);
int i, j;
case SUBREG:
if (!REG_P (SUBREG_REG (x)))
- mark_referenced_resources (SUBREG_REG (x), res, 0);
+ mark_referenced_resources (SUBREG_REG (x), res, false);
else
{
unsigned int regno = subreg_regno (x);
res->volatil |= MEM_VOLATILE_P (x);
/* Mark registers used to access memory. */
- mark_referenced_resources (XEXP (x, 0), res, 0);
+ mark_referenced_resources (XEXP (x, 0), res, false);
return;
case CC0:
traditional asms unlike their normal usage. */
for (i = 0; i < ASM_OPERANDS_INPUT_LENGTH (x); i++)
- mark_referenced_resources (ASM_OPERANDS_INPUT (x, i), res, 0);
+ mark_referenced_resources (ASM_OPERANDS_INPUT (x, i), res, false);
return;
case CALL:
/* The first operand will be a (MEM (xxx)) but doesn't really reference
memory. The second operand may be referenced, though. */
- mark_referenced_resources (XEXP (XEXP (x, 0), 0), res, 0);
- mark_referenced_resources (XEXP (x, 1), res, 0);
+ mark_referenced_resources (XEXP (XEXP (x, 0), 0), res, false);
+ mark_referenced_resources (XEXP (x, 1), res, false);
return;
case SET:
registers used to access memory are referenced. SET_DEST is
also referenced if it is a ZERO_EXTRACT. */
- mark_referenced_resources (SET_SRC (x), res, 0);
+ mark_referenced_resources (SET_SRC (x), res, false);
x = SET_DEST (x);
if (GET_CODE (x) == ZERO_EXTRACT
|| GET_CODE (x) == STRICT_LOW_PART)
- mark_referenced_resources (x, res, 0);
+ mark_referenced_resources (x, res, false);
else if (GET_CODE (x) == SUBREG)
x = SUBREG_REG (x);
if (MEM_P (x))
- mark_referenced_resources (XEXP (x, 0), res, 0);
+ mark_referenced_resources (XEXP (x, 0), res, false);
return;
case CLOBBER:
}
if (i >= seq_size)
mark_referenced_resources (XEXP (XEXP (link, 0), 0),
- res, 0);
+ res, false);
}
}
}
if (jump_count >= 10)
break;
- mark_referenced_resources (insn, &needed, 1);
+ mark_referenced_resources (insn, &needed, true);
/* For an annulled branch, mark_set_resources ignores slots
filled by instructions from the target. This is correct
}
}
- mark_referenced_resources (insn, &needed, 1);
+ mark_referenced_resources (insn, &needed, true);
mark_set_resources (insn, &set, 0, MARK_SRC_DEST_CALL);
COPY_HARD_REG_SET (scratch, set.regs);
else if (return_insn_p (target))
{
*res = end_of_function_needs;
- mark_referenced_resources (target, res, 0);
+ mark_referenced_resources (target, res, false);
return;
}
/* If we found a basic block, get the live registers from it and update
them with anything set or killed between its start and the insn before
- TARGET. Otherwise, we must assume everything is live. */
+ TARGET; this custom life analysis is really about registers so we need
+ to use the LR problem. Otherwise, we must assume everything is live. */
if (b != -1)
{
- regset regs_live = df_get_live_in (BASIC_BLOCK (b));
+ regset regs_live = DF_LR_IN (BASIC_BLOCK (b));
rtx start_insn, stop_insn;
/* Compute hard regs live at start of block. */
/* Get starting and ending insn, handling the case where each might
be a SEQUENCE. */
- start_insn = (b == ENTRY_BLOCK_PTR->next_bb->index ?
+ start_insn = (b == ENTRY_BLOCK_PTR->next_bb->index ?
insns : BB_HEAD (BASIC_BLOCK (b)));
stop_insn = target;
rtx real_insn = insn;
enum rtx_code code = GET_CODE (insn);
+ if (DEBUG_INSN_P (insn))
+ continue;
+
/* If this insn is from the target of a branch, it isn't going to
be used in the sequel. If it is used in both cases, this
test will not be true. */
{
HARD_REG_SET extra_live;
- REG_SET_TO_HARD_REG_SET (extra_live, df_get_live_in (bb));
+ REG_SET_TO_HARD_REG_SET (extra_live, DF_LR_IN (bb));
IOR_HARD_REG_SET (current_live_regs, extra_live);
}
}
/* Include JUMP_INSN in the needed registers. */
for (insn = target; insn != stop_insn; insn = next_active_insn (insn))
{
- mark_referenced_resources (insn, &needed, 1);
+ mark_referenced_resources (insn, &needed, true);
COPY_HARD_REG_SET (scratch, needed.regs);
AND_COMPL_HARD_REG_SET (scratch, set.regs);
if (crtl->return_rtx != 0)
mark_referenced_resources (crtl->return_rtx,
- &end_of_function_needs, 1);
+ &end_of_function_needs, true);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (global_regs[i]
/* Add TRIAL to the set of resources used at the end of the current
function. */
void
-mark_end_of_function_resources (rtx trial, int include_delayed_effects)
+mark_end_of_function_resources (rtx trial, bool include_delayed_effects)
{
mark_referenced_resources (trial, &end_of_function_needs,
include_delayed_effects);