On Wed, Jul 12, 2017 at 03:30:00PM +0200, Georg-Johann Lay wrote: > On 12.07.2017 14:11, Segher Boessenkool wrote: > >On Tue, Jul 11, 2017 at 10:47:27AM +0200, Georg-Johann Lay wrote: > >>This small addition improves costs of PARALLELs in > >>rtlanal.c:seq_cost(). Up to now, these costs are > >>assumed to be 1 which gives gross inexact costs for, > >>e.g. divmod which is represented as PARALLEL. > > > >insn_rtx_cost returns 0 ("unknown") for such a PARALLEL, so your > >current patch does not change this at all? > > Huh? It returns the costs of 1st SET in a PARALLEL (provided it > has one), no? Or even costs for come compares.
No, it returns 0 if there is more than one normal SET (or more than one compare). > >>+ else if (INSN_P (seq) > >>+ && PARALLEL == GET_CODE (PATTERN (seq))) > > > >Yoda conditions have we should not. > > hmm, I didn't find something like PARALLEL_P (rtx). > Is comparing rtx_codes deprecated now? I meant it should be written else if (INSN_P (seq) && GET_CODE (PATTERN (seq)) == PARALLEL) i.e. constant on the right. > >This whole thing could be something like > > > > if (INSN_P (seq)) > > { > > int t = insn_rtx_cost (PATTERN (seq), speed); > > This will behave differently. Yes, I know, I even said so. > >(Why do you need a check for INSN_P here? Why does it increment the > > >cost for non-insns? So many questions). > > Again, you'll have to ask the original author for reasoning. Since you want to change the code, to make it better, I was hoping you would dig in a bit. To make it better, not just different :-/ Segher