On 08/27/2014 09:32 AM, David Malcolm wrote:
>       * gcc/config/mn10300/mn10300.c (is_load_insn): Rename to...
>       (set_is_load_p): ...this, updating to work on a SET pattern rather
>       than an insn.
>       (is_store_insn): Rename to...
>       (set_is_store_p): ...this, updating to work on a SET pattern
>       rather than an insn.
>       (mn10300_adjust_sched_cost): Move call to get_attr_timings from
>       top of function to where it is needed.  Rewrite the bogus
>       condition that checks for "insn" and "dep" being PARALLEL to
>       instead use single_set, introducing locals "insn_set" and
>       "dep_set".  Given that we only ever returned "cost" for a non-pair
>       of SETs, bail out early if we don't have a pair of SET.
>       Rewrite all uses of PATTERN (dep) and PATTERN (insn) to instead
>       use the new locals "insn_set" and "dep_set", and update calls to
>       is_load_insn and is_store_insn to be calls to set_is_load_p and
>       set_is_store_p.

Ok, if it passes your smoke tests.

> +  /* We are only interested in pairs of SET. */
> +  insn_set = single_set (insn);
> +  if (!insn_set)
> +    return cost;
>  
> +  dep_set = single_set (dep);
> +  if (!dep_set)
> +    return cost;
>  
> +  gcc_assert (GET_CODE (insn_set) == SET);
> +  gcc_assert (GET_CODE (dep_set) == SET);

I don't think you need the asserts; we should be able to trust single_set.


r~

Reply via email to