This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RTX costs


Joern Rennecke wrote:
Quoting "Paulo J. Matos" <pocmatos@gmail.com>:

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 instructions will be
generated for a particular insn?
- or something else?

When optimizing for speed, they estimate execution cycles, when optimizing for space, they estimate code size. In each case, normalized so that COSTS_N_INSNS (1) is equivalent to the cost of a simple instruction. Or at least that's the theoretical goal. Individual ports might deviate from that for historical and/or practical reasons.

Thanks for the reply. The name of the macro COSTS_N_INSNS was making me think I was estimating numbers of insns instead of number of assembler instructions even though when optimising for size the latter makes more sense.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]