Re: Just what are rtx costs?

2011-08-26 Thread Georg-Johann Lay
make insn_rtx_cost take account >>>>> of the cost of SET_DESTs as well as SET_SRCs. But I'm slowly >>>>> beginning to realise that I don't understand what rtx costs are >>>>> supposed to represent. >>>>> >>>>&g

Re: Just what are rtx costs?

2011-08-22 Thread Peter Bigot
>>>> of the cost of SET_DESTs as well as SET_SRCs.  But I'm slowly beginning >>>> to realise that I don't understand what rtx costs are supposed to >>>> represent. >>>> >>>> AIUI the rules have historically been: >>>> >

Re: Just what are rtx costs?

2011-08-22 Thread David Edelsohn
On Mon, Aug 22, 2011 at 9:08 AM, Joern Rennecke wrote: > Quoting Richard Guenther : > >>> So are you saying that we should remove the recursive nature of the >>> rtx_cost/targetm.rtx_costs interface, and have the backend handle any >>> recursion itself?  I.e. targetm.rtx_costs only ever sees a com

Re: Just what are rtx costs?

2011-08-22 Thread Joern Rennecke
Quoting Richard Guenther : So are you saying that we should remove the recursive nature of the rtx_cost/targetm.rtx_costs interface, and have the backend handle any recursion itself?  I.e. targetm.rtx_costs only ever sees a complete (but perhaps invalid) instruction pattern?  Or would you still

Re: Just what are rtx costs?

2011-08-22 Thread Georg-Johann Lay
>>> expensive. >> No, that complexity is not needed. For (set (reg) (const_int)) the BE >> can just return the cost of the expanded sequence because it knows how >> it will be expanded and how much it will cost. There's no need to >> really expand the sequence

Re: Just what are rtx costs?

2011-08-22 Thread Richard Guenther
instruction.  But that's potentially >>> expensive. >> >> No, that complexity is not needed.  For (set (reg) (const_int)) the BE >> can just return the cost of the expanded sequence because it knows how >> it will be expanded and how much it will cost.  There&

Re: Just what are rtx costs?

2011-08-22 Thread Richard Sandiford
r (set (reg) (const_int)) the BE > can just return the cost of the expanded sequence because it knows how > it will be expanded and how much it will cost. There's no need to > really expand the sequence. Sorry, I'd misunderstood your suggestion. I thought you were suggesting

Re: Just what are rtx costs?

2011-08-21 Thread Georg-Johann Lay
Richard Sandiford schrieb: Georg-Johann Lay writes: Richard Sandiford schrieb: I've been working on some patches to make insn_rtx_cost take account of the cost of SET_DESTs as well as SET_SRCs. But I'm slowly beginning to realise that I don't understand what rtx costs

Re: Just what are rtx costs?

2011-08-19 Thread Richard Sandiford
Hans-Peter Nilsson writes: >> But that hardly seems clean either. Perhaps we should instead make >> the SET_SRC always include the cost of the SET, even for registers, >> constants and the like. Thoughts? > > Seems more of maintaining a wart than an improvement for > consistency. So, to enumera

Re: Just what are rtx costs?

2011-08-19 Thread Richard Sandiford
Georg-Johann Lay writes: > Richard Sandiford schrieb: >> I've been working on some patches to make insn_rtx_cost take account >> of the cost of SET_DESTs as well as SET_SRCs. But I'm slowly beginning >> to realise that I don't understand what rtx costs are su

Re: Just what are rtx costs?

2011-08-18 Thread Richard Sandiford
improve > this area for consistency: between releases a port already > usually arbitrarily loses on some type of codes and costs have > to be re-tweaked, unless performance is closely tracked. Yeah, probably true. Certainly a good excuse for me to use. :-) > Aiming for traceability can

Re: Just what are rtx costs?

2011-08-18 Thread Richard Sandiford
Thanks for the feedback. Paolo Bonzini writes: > On 08/17/2011 07:52 AM, Richard Sandiford wrote: >>cost = rtx_cost (SET_SRC (set), SET, speed); >>return cost> 0 ? cost : COSTS_N_INSNS (1); >> >> This ignores SET_DEST (the problem I'm trying to fix). It also means >> that constants that

Re: Just what are rtx costs?

2011-08-17 Thread Hans-Peter Nilsson
than an improvement for consistency. I don't think you can get into trouble for trying to improve this area for consistency: between releases a port already usually arbitrarily loses on some type of codes and costs have to be re-tweaked, unless performance is closely tracked. Aiming for traceabil

Re: Just what are rtx costs?

2011-08-17 Thread Paolo Bonzini
On 08/17/2011 07:52 AM, Richard Sandiford wrote: cost = rtx_cost (SET_SRC (set), SET, speed); return cost> 0 ? cost : COSTS_N_INSNS (1); This ignores SET_DEST (the problem I'm trying to fix). It also means that constants that are slightly more expensive than a register -- somewhere in th

Re: Just what are rtx costs?

2011-08-17 Thread Georg-Johann Lay
Richard Sandiford schrieb: I've been working on some patches to make insn_rtx_cost take account of the cost of SET_DESTs as well as SET_SRCs. But I'm slowly beginning to realise that I don't understand what rtx costs are supposed to represent. AIUI the rules have historic

Just what are rtx costs?

2011-08-17 Thread Richard Sandiford
I've been working on some patches to make insn_rtx_cost take account of the cost of SET_DESTs as well as SET_SRCs. But I'm slowly beginning to realise that I don't understand what rtx costs are supposed to represent. AIUI the rules have historically been: 1) Registers have

Re: Calculation of RTX Costs

2010-09-24 Thread Paulo J. Matos
Ian Lance Taylor writes: > pocma...@gmail.com (Paulo J. Matos) writes: > > For most processors it's not important to get all costs exactly correct. > The compiler uses the costs in a relatively brute force manner. If > there is only one way to do some operation, then its cost is irrelevant. > Co

Re: Calculation of RTX Costs

2010-09-23 Thread Ian Lance Taylor
ks for: > - register move > - memory move > - branches > - rtx > - address > > only the last two refer to the use of COSTS_N_INSNS. How do the > value for a register move (which defaults to 2), will compare to an rtx > cost? You should be defining your rtx costs with the

Re: Calculation of RTX Costs

2010-09-23 Thread Paulo J. Matos
Ian Lance Taylor writes: > pocma...@gmail.com (Paulo J. Matos) writes: > >> Moreover, is there a reason for the existence of COST_N_INSNS(x) and why >> this multiplies x by 4? Is 4 just a special number? Any reason on why I >> should be using COST_N_INSNS instead of just assigning *total (of >> t

Re: Calculation of RTX Costs

2010-09-21 Thread Ian Lance Taylor
pocma...@gmail.com (Paulo J. Matos) writes: > I would like some clarification on the meaning of RTX Costs. > When optimising for speed I assume they estimate the time at which the > final generated code is going to take to execute for each rtx. > When optimising for size it is t

Calculation of RTX Costs

2010-09-21 Thread Paulo J. Matos
Hello, I would like some clarification on the meaning of RTX Costs. When optimising for speed I assume they estimate the time at which the final generated code is going to take to execute for each rtx. When optimising for size it is the estimated number of words that each rtx will generate in the

Re: RTX costs

2010-02-09 Thread Paulo J. Matos
Joern Rennecke wrote: Quoting "Paulo J. Matos" : Hi all, After reading the internal docs about rtx_costs I am left wondering what they exactly are estimating. - Are they estimating in the beginning of expand how many insns will be generated from a particular insn until the assembler is generat

Re: RTX costs

2010-02-09 Thread Richard Kenner
> After reading the internal docs about rtx_costs I am left wondering what > they exactly are estimating. > - Are they estimating in the beginning of expand how many insns will be > generated from a particular insn until the assembler is generated? > - or Are they estimating how many assembler in

Re: RTX costs

2010-02-09 Thread Joern Rennecke
Quoting "Paulo J. Matos" : Hi all, After reading the internal docs about rtx_costs I am left wondering what they exactly are estimating. - Are they estimating in the beginning of expand how many insns will be generated from a particular insn until the assembler is generated? - or Are they estim

RTX costs

2010-02-09 Thread Paulo J. Matos
Hi all, After reading the internal docs about rtx_costs I am left wondering what they exactly are estimating. - Are they estimating in the beginning of expand how many insns will be generated from a particular insn until the assembler is generated? - or Are they estimating how many assembler in