This is the mail archive of the gcc-patches@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: RFC patch: invariant addresses too cheap


Richard Sandiford wrote:

>>> But then you should document that address-cost is supposed to be
>>> insn-cost based.  Otherwise comparing apples with oranges doesn't
>>> make sense, even if it might look less magic to you.
>> That's true.
> 
> Yeah.  We'd also have to document that "half an insn" is considered cheap.
> And what does that really mean?  Are we saying that "at most half of an
> insn can be given over to address calculation"?  Seems a bit of a weird
> concept to hard-wire into the compiler.

I'm late to this party, but I agree.

I've been bothered by the COST_N_INSNS costs vs. random-integer costs
discrepancy in the past, and at one point I tracked down some bad
optimization decisions to a case where we comparing between the two.
(Maybe we weren't supposed to be doing that, but we were.)

I think COST_N_INSNS, while an approximation of reality (not all
instructions have the same cost of course), is a plausible framework,
but it seems more general just to use integers for costs, with all such
integers coming from the back end, and the target-independent code
limited to combining those integers using formulas.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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