|
|
[ xf. http://gcc.gnu.org/ml/gcc-patches/2009-03/msg01315.html ]
> +static int
> +check_reg_count_callback (rtx *px, void *data)
Misses comment before the function.
> +{
> + int *regnop = (int *) data;
> +
> + if (!REG_P (*px))
> + return 0;
> +
> + if (*regnop < 0 || *regnop == (int) REGNO (*px))
Eh, when can you have *regnop < 0?
> + {
> + *regnop = REGNO (*px);
> + return 0;
> + }
> +
> + return 1;
> +}
> +
> +/* Try to replace USE with SRC (defined in DEF_INSN) in __asm. */
> +
> +static bool
> +forward_propagate_asm (df_ref use, rtx def_set, rtx reg)
Where is DEF_INSN? You mean DEF_SET in the comment, I think.
> +{
> + rtx use_insn = DF_REF_INSN (use), src, use_pat, asm_operands, new_rtx,
> *loc;
> + int regno, speed_p, i;
> +
> + gcc_assert ((DF_REF_FLAGS (use) & DF_REF_IN_NOTE) == 0);
> +
> + src = SET_SRC (def_set);
> + use_pat = PATTERN (use_insn);
> +
> + /* In __asm don't replace if src might need more registers than
> + reg, as that could increase register pressure on the __asm. */
> + regno = -1;
> + if (for_each_rtx (&src, check_reg_count_callback, ®no) > 0)
> + return false;
Can you use DF_INSN_USES of DEF_SET instead here? All for_each_rtx and
note_stores should die in places where the DF cache can use :-)
Ciao!
Steven
|
|