[PATCH, SMS] Prevent the creation of reg-moves for definitions with MODE_CC
Richard Sandiford
richard.sandiford@linaro.org
Tue Dec 20 18:14:00 GMT 2011
Revital Eres <revital.eres@linaro.org> writes:
> +/* Return true if one of the definitions in INSN has MODE_CC. Otherwise
> + return false. */
> +static bool
> +def_has_ccmode_p (rtx insn)
> +{
> + df_ref *def;
> +
> + for (def = DF_INSN_DEFS (insn); *def; def++)
> + {
> + enum machine_mode mode = GET_MODE (DF_REF_REG (*def));
> +
> + if (GET_MODE_CLASS (mode) == MODE_CC)
> + return true;
> + }
> +
> + return false;
> +}
FWIW, an alternative might be to test have_regs_of_mode[(int) mode].
That says whether there are any allocatable (non-fixed) registers
of the given mode.
Richard
More information about the Gcc-patches
mailing list