On 08/27/2014 08:48 AM, David Malcolm wrote:
> Alternatively, should this simply use "single_set"?
Yes.
> (though I think that's a more invasive change, especially since some of
> the logic is for non-SETs).
I don't think that's the case. Take the tests in order:
if (mn10300_tune_cpu == PROCESSOR_AM34
&& is_load_insn (dep)
&& is_store_insn (insn))
cost += 1;
Requires sets for both.
else if (mn10300_tune_cpu == PROCESSOR_AM34
&& ! is_store_insn (insn)
&& ! JUMP_P (insn)
&& GET_CODE (PATTERN (dep)) == SET
&& GET_CODE (PATTERN (insn)) == SET
Duh.
if (GET_CODE (PATTERN (dep)) != SET)
return cost;
Filtering out non-sets from dep.
/* Now check to see if the previous instruction is a load or store. */
if (! is_load_insn (insn) && ! is_store_insn (insn))
return cost;
Filtering out non-sets from insn.
Thus in no case do we return anything but the original "cost" when either the
dep or insn pattern is not a set.
Oh, and while you're massaging this function...
mn10300_adjust_sched_cost (rtx insn, rtx link, rtx dep, int cost)
{
int timings = get_attr_timings (insn);
...
/* Extract the latency value from the timings attribute. */
return timings < 100 ? (timings % 10) : (timings % 100);
}
Will you please move the (expensive) get_attr_timings call to the end, after
we've discarded all of the cases in which it isn't used?
r~